<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Class: GridStore</title>
    
    
    
    
    
    <meta property="og:title" content=""/>
    <meta property="og:type" content="website"/>
    <meta property="og:image" content=""/>
    
    <meta property="og:url" content=""/>
    
    <script src="scripts/prettify/prettify.js"></script>
    <script src="scripts/prettify/lang-css.js"></script>
    <script src="scripts/jquery.min.js"></script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/bootstrap.min.css">
    <link type="text/css" rel="stylesheet" href="styles/jaguar.css">
    
    
    <script>
    var config = {"monospaceLinks":true,"cleverLinks":true,"default":{"outputSourceFiles":true},"applicationName":"Node.js MongoDB Driver API","googleAnalytics":"UA-29229787-1","openGraph":{"title":"","type":"website","image":"","site_name":"","url":""},"meta":{"title":"","description":"","keyword":""},"linenums":true};
    </script>
    

    
    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

      ga('create', UA-29229787-1, 'auto');
      ga('send', 'pageview');
    </script>    
    
</head>
<body>
<div id="wrap" class="clearfix" style="width:100%;">
    <table style="height:100%;width:100%">
        <tr>
            <td valign='top' width="1px">
                
<div class="navigation">
    <h3 class="applicationName"><a href="index.html">Node.js MongoDB Driver API</a></h3>

    <div class="search">
        <input id="search" type="text" class="form-control input-sm" placeholder="Search Documentations">
    </div>
    <ul class="list">
    
        <li class="item" data-name="Admin">
            <span class="title">
                <a href="Admin.html">Admin</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            <span class="subtitle">Typedefs</span>
            
                <li data-name="Admin~resultCallback"><a href="Admin.html#~resultCallback">resultCallback</a></li>
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="Admin#addUser"><a href="Admin.html#addUser">addUser</a></li>
            
                <li data-name="Admin#authenticate"><a href="Admin.html#authenticate">authenticate</a></li>
            
                <li data-name="Admin#buildInfo"><a href="Admin.html#buildInfo">buildInfo</a></li>
            
                <li data-name="Admin#command"><a href="Admin.html#command">command</a></li>
            
                <li data-name="Admin#listDatabases"><a href="Admin.html#listDatabases">listDatabases</a></li>
            
                <li data-name="Admin#logout"><a href="Admin.html#logout">logout</a></li>
            
                <li data-name="Admin#ping"><a href="Admin.html#ping">ping</a></li>
            
                <li data-name="Admin#profilingInfo"><a href="Admin.html#profilingInfo">profilingInfo</a></li>
            
                <li data-name="Admin#profilingLevel"><a href="Admin.html#profilingLevel">profilingLevel</a></li>
            
                <li data-name="Admin#removeUser"><a href="Admin.html#removeUser">removeUser</a></li>
            
                <li data-name="Admin#replSetGetStatus"><a href="Admin.html#replSetGetStatus">replSetGetStatus</a></li>
            
                <li data-name="Admin#serverInfo"><a href="Admin.html#serverInfo">serverInfo</a></li>
            
                <li data-name="Admin#serverStatus"><a href="Admin.html#serverStatus">serverStatus</a></li>
            
                <li data-name="Admin#setProfilingLevel"><a href="Admin.html#setProfilingLevel">setProfilingLevel</a></li>
            
                <li data-name="Admin#validateCollection"><a href="Admin.html#validateCollection">validateCollection</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="AggregationCursor">
            <span class="title">
                <a href="AggregationCursor.html">AggregationCursor</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            <span class="subtitle">Typedefs</span>
            
                <li data-name="AggregationCursor~endCallback"><a href="AggregationCursor.html#~endCallback">endCallback</a></li>
            
                <li data-name="AggregationCursor~iteratorCallback"><a href="AggregationCursor.html#~iteratorCallback">iteratorCallback</a></li>
            
                <li data-name="AggregationCursor~resultCallback"><a href="AggregationCursor.html#~resultCallback">resultCallback</a></li>
            
                <li data-name="AggregationCursor~toArrayResultCallback"><a href="AggregationCursor.html#~toArrayResultCallback">toArrayResultCallback</a></li>
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="AggregationCursor#batchSize"><a href="AggregationCursor.html#batchSize">batchSize</a></li>
            
                <li data-name="AggregationCursor#clone"><a href="AggregationCursor.html#clone">clone</a></li>
            
                <li data-name="AggregationCursor#close"><a href="AggregationCursor.html#close">close</a></li>
            
                <li data-name="AggregationCursor#each"><a href="AggregationCursor.html#each">each</a></li>
            
                <li data-name="AggregationCursor#explain"><a href="AggregationCursor.html#explain">explain</a></li>
            
                <li data-name="AggregationCursor#geoNear"><a href="AggregationCursor.html#geoNear">geoNear</a></li>
            
                <li data-name="AggregationCursor#group"><a href="AggregationCursor.html#group">group</a></li>
            
                <li data-name="AggregationCursor#hasNext"><a href="AggregationCursor.html#hasNext">hasNext</a></li>
            
                <li data-name="AggregationCursor#isClosed"><a href="AggregationCursor.html#isClosed">isClosed</a></li>
            
                <li data-name="AggregationCursor#limit"><a href="AggregationCursor.html#limit">limit</a></li>
            
                <li data-name="AggregationCursor#lookup"><a href="AggregationCursor.html#lookup">lookup</a></li>
            
                <li data-name="AggregationCursor#match"><a href="AggregationCursor.html#match">match</a></li>
            
                <li data-name="AggregationCursor#maxTimeMS"><a href="AggregationCursor.html#maxTimeMS">maxTimeMS</a></li>
            
                <li data-name="AggregationCursor#next"><a href="AggregationCursor.html#next">next</a></li>
            
                <li data-name="AggregationCursor#out"><a href="AggregationCursor.html#out">out</a></li>
            
                <li data-name="AggregationCursor#pause"><a href="AggregationCursor.html#pause">pause</a></li>
            
                <li data-name="AggregationCursor#pipe"><a href="AggregationCursor.html#pipe">pipe</a></li>
            
                <li data-name="AggregationCursor#project"><a href="AggregationCursor.html#project">project</a></li>
            
                <li data-name="AggregationCursor#read"><a href="AggregationCursor.html#read">read</a></li>
            
                <li data-name="AggregationCursor#redact"><a href="AggregationCursor.html#redact">redact</a></li>
            
                <li data-name="AggregationCursor#resume"><a href="AggregationCursor.html#resume">resume</a></li>
            
                <li data-name="AggregationCursor#rewind"><a href="AggregationCursor.html#rewind">rewind</a></li>
            
                <li data-name="AggregationCursor#setEncoding"><a href="AggregationCursor.html#setEncoding">setEncoding</a></li>
            
                <li data-name="AggregationCursor#skip"><a href="AggregationCursor.html#skip">skip</a></li>
            
                <li data-name="AggregationCursor#sort"><a href="AggregationCursor.html#sort">sort</a></li>
            
                <li data-name="AggregationCursor#toArray"><a href="AggregationCursor.html#toArray">toArray</a></li>
            
                <li data-name="AggregationCursor#unpipe"><a href="AggregationCursor.html#unpipe">unpipe</a></li>
            
                <li data-name="AggregationCursor#unshift"><a href="AggregationCursor.html#unshift">unshift</a></li>
            
                <li data-name="AggregationCursor#unwind"><a href="AggregationCursor.html#unwind">unwind</a></li>
            
                <li data-name="AggregationCursor#wrap"><a href="AggregationCursor.html#wrap">wrap</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            <span class="subtitle">Events</span>
            
                <li data-name="AggregationCursor#event:close"><a href="AggregationCursor.html#event:close">close</a></li>
            
                <li data-name="AggregationCursor#event:data"><a href="AggregationCursor.html#event:data">data</a></li>
            
                <li data-name="AggregationCursor#event:end"><a href="AggregationCursor.html#event:end">end</a></li>
            
                <li data-name="AggregationCursor#event:readable"><a href="AggregationCursor.html#event:readable">readable</a></li>
            
            </ul>
        </li>
    
        <li class="item" data-name="Binary">
            <span class="title">
                <a href="Binary.html">Binary</a>
                
            </span>
            <ul class="members itemMembers">
            
            <span class="subtitle">Members</span>
            
                <li data-name="Binary.SUBTYPE_BYTE_ARRAY"><a href="Binary.html#.SUBTYPE_BYTE_ARRAY">SUBTYPE_BYTE_ARRAY</a></li>
            
                <li data-name="Binary.SUBTYPE_DEFAULT"><a href="Binary.html#.SUBTYPE_DEFAULT">SUBTYPE_DEFAULT</a></li>
            
                <li data-name="Binary.SUBTYPE_FUNCTION"><a href="Binary.html#.SUBTYPE_FUNCTION">SUBTYPE_FUNCTION</a></li>
            
                <li data-name="Binary.SUBTYPE_MD5"><a href="Binary.html#.SUBTYPE_MD5">SUBTYPE_MD5</a></li>
            
                <li data-name="Binary.SUBTYPE_USER_DEFINED"><a href="Binary.html#.SUBTYPE_USER_DEFINED">SUBTYPE_USER_DEFINED</a></li>
            
                <li data-name="Binary.SUBTYPE_UUID"><a href="Binary.html#.SUBTYPE_UUID">SUBTYPE_UUID</a></li>
            
                <li data-name="Binary.SUBTYPE_UUID_OLD"><a href="Binary.html#.SUBTYPE_UUID_OLD">SUBTYPE_UUID_OLD</a></li>
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="Binary#length"><a href="Binary.html#length">length</a></li>
            
                <li data-name="Binary#put"><a href="Binary.html#put">put</a></li>
            
                <li data-name="Binary#read"><a href="Binary.html#read">read</a></li>
            
                <li data-name="Binary#value"><a href="Binary.html#value">value</a></li>
            
                <li data-name="Binary#write"><a href="Binary.html#write">write</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="BSONRegExp">
            <span class="title">
                <a href="BSONRegExp.html">BSONRegExp</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="BulkWriteResult">
            <span class="title">
                <a href="BulkWriteResult.html">BulkWriteResult</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="BulkWriteResult#getInsertedIds"><a href="BulkWriteResult.html#getInsertedIds">getInsertedIds</a></li>
            
                <li data-name="BulkWriteResult#getLastOp"><a href="BulkWriteResult.html#getLastOp">getLastOp</a></li>
            
                <li data-name="BulkWriteResult#getRawResponse"><a href="BulkWriteResult.html#getRawResponse">getRawResponse</a></li>
            
                <li data-name="BulkWriteResult#getUpsertedIdAt"><a href="BulkWriteResult.html#getUpsertedIdAt">getUpsertedIdAt</a></li>
            
                <li data-name="BulkWriteResult#getUpsertedIds"><a href="BulkWriteResult.html#getUpsertedIds">getUpsertedIds</a></li>
            
                <li data-name="BulkWriteResult#getWriteConcernError"><a href="BulkWriteResult.html#getWriteConcernError">getWriteConcernError</a></li>
            
                <li data-name="BulkWriteResult#getWriteErrorAt"><a href="BulkWriteResult.html#getWriteErrorAt">getWriteErrorAt</a></li>
            
                <li data-name="BulkWriteResult#getWriteErrorCount"><a href="BulkWriteResult.html#getWriteErrorCount">getWriteErrorCount</a></li>
            
                <li data-name="BulkWriteResult#getWriteErrors"><a href="BulkWriteResult.html#getWriteErrors">getWriteErrors</a></li>
            
                <li data-name="BulkWriteResult#hasWriteErrors"><a href="BulkWriteResult.html#hasWriteErrors">hasWriteErrors</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="Code">
            <span class="title">
                <a href="Code.html">Code</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="Collection">
            <span class="title">
                <a href="Collection.html">Collection</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            <span class="subtitle">Typedefs</span>
            
                <li data-name="Collection~bulkWriteOpCallback"><a href="Collection.html#~bulkWriteOpCallback">bulkWriteOpCallback</a></li>
            
                <li data-name="Collection~BulkWriteOpResult"><a href="Collection.html#~BulkWriteOpResult">BulkWriteOpResult</a></li>
            
                <li data-name="Collection~collectionResultCallback"><a href="Collection.html#~collectionResultCallback">collectionResultCallback</a></li>
            
                <li data-name="Collection~countCallback"><a href="Collection.html#~countCallback">countCallback</a></li>
            
                <li data-name="Collection~deleteWriteOpCallback"><a href="Collection.html#~deleteWriteOpCallback">deleteWriteOpCallback</a></li>
            
                <li data-name="Collection~deleteWriteOpResult"><a href="Collection.html#~deleteWriteOpResult">deleteWriteOpResult</a></li>
            
                <li data-name="Collection~findAndModifyCallback"><a href="Collection.html#~findAndModifyCallback">findAndModifyCallback</a></li>
            
                <li data-name="Collection~findAndModifyWriteOpResult"><a href="Collection.html#~findAndModifyWriteOpResult">findAndModifyWriteOpResult</a></li>
            
                <li data-name="Collection~insertOneWriteOpCallback"><a href="Collection.html#~insertOneWriteOpCallback">insertOneWriteOpCallback</a></li>
            
                <li data-name="Collection~insertOneWriteOpResult"><a href="Collection.html#~insertOneWriteOpResult">insertOneWriteOpResult</a></li>
            
                <li data-name="Collection~insertWriteOpCallback"><a href="Collection.html#~insertWriteOpCallback">insertWriteOpCallback</a></li>
            
                <li data-name="Collection~insertWriteOpResult"><a href="Collection.html#~insertWriteOpResult">insertWriteOpResult</a></li>
            
                <li data-name="Collection~parallelCollectionScanCallback"><a href="Collection.html#~parallelCollectionScanCallback">parallelCollectionScanCallback</a></li>
            
                <li data-name="Collection~resultCallback"><a href="Collection.html#~resultCallback">resultCallback</a></li>
            
                <li data-name="Collection~updateWriteOpCallback"><a href="Collection.html#~updateWriteOpCallback">updateWriteOpCallback</a></li>
            
                <li data-name="Collection~updateWriteOpResult"><a href="Collection.html#~updateWriteOpResult">updateWriteOpResult</a></li>
            
                <li data-name="Collection~writeOpCallback"><a href="Collection.html#~writeOpCallback">writeOpCallback</a></li>
            
                <li data-name="Collection~WriteOpResult"><a href="Collection.html#~WriteOpResult">WriteOpResult</a></li>
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="Collection#aggregate"><a href="Collection.html#aggregate">aggregate</a></li>
            
                <li data-name="Collection#bulkWrite"><a href="Collection.html#bulkWrite">bulkWrite</a></li>
            
                <li data-name="Collection#count"><a href="Collection.html#count">count</a></li>
            
                <li data-name="Collection#createIndex"><a href="Collection.html#createIndex">createIndex</a></li>
            
                <li data-name="Collection#createIndexes"><a href="Collection.html#createIndexes">createIndexes</a></li>
            
                <li data-name="Collection#deleteMany"><a href="Collection.html#deleteMany">deleteMany</a></li>
            
                <li data-name="Collection#deleteOne"><a href="Collection.html#deleteOne">deleteOne</a></li>
            
                <li data-name="Collection#distinct"><a href="Collection.html#distinct">distinct</a></li>
            
                <li data-name="Collection#drop"><a href="Collection.html#drop">drop</a></li>
            
                <li data-name="Collection#dropAllIndexes"><a href="Collection.html#dropAllIndexes">dropAllIndexes</a></li>
            
                <li data-name="Collection#dropIndex"><a href="Collection.html#dropIndex">dropIndex</a></li>
            
                <li data-name="Collection#dropIndexes"><a href="Collection.html#dropIndexes">dropIndexes</a></li>
            
                <li data-name="Collection#ensureIndex"><a href="Collection.html#ensureIndex">ensureIndex</a></li>
            
                <li data-name="Collection#find"><a href="Collection.html#find">find</a></li>
            
                <li data-name="Collection#findAndModify"><a href="Collection.html#findAndModify">findAndModify</a></li>
            
                <li data-name="Collection#findAndRemove"><a href="Collection.html#findAndRemove">findAndRemove</a></li>
            
                <li data-name="Collection#findOne"><a href="Collection.html#findOne">findOne</a></li>
            
                <li data-name="Collection#findOneAndDelete"><a href="Collection.html#findOneAndDelete">findOneAndDelete</a></li>
            
                <li data-name="Collection#findOneAndReplace"><a href="Collection.html#findOneAndReplace">findOneAndReplace</a></li>
            
                <li data-name="Collection#findOneAndUpdate"><a href="Collection.html#findOneAndUpdate">findOneAndUpdate</a></li>
            
                <li data-name="Collection#geoHaystackSearch"><a href="Collection.html#geoHaystackSearch">geoHaystackSearch</a></li>
            
                <li data-name="Collection#geoNear"><a href="Collection.html#geoNear">geoNear</a></li>
            
                <li data-name="Collection#group"><a href="Collection.html#group">group</a></li>
            
                <li data-name="Collection#indexes"><a href="Collection.html#indexes">indexes</a></li>
            
                <li data-name="Collection#indexExists"><a href="Collection.html#indexExists">indexExists</a></li>
            
                <li data-name="Collection#indexInformation"><a href="Collection.html#indexInformation">indexInformation</a></li>
            
                <li data-name="Collection#initializeOrderedBulkOp"><a href="Collection.html#initializeOrderedBulkOp">initializeOrderedBulkOp</a></li>
            
                <li data-name="Collection#initializeUnorderedBulkOp"><a href="Collection.html#initializeUnorderedBulkOp">initializeUnorderedBulkOp</a></li>
            
                <li data-name="Collection#insert"><a href="Collection.html#insert">insert</a></li>
            
                <li data-name="Collection#insertMany"><a href="Collection.html#insertMany">insertMany</a></li>
            
                <li data-name="Collection#insertOne"><a href="Collection.html#insertOne">insertOne</a></li>
            
                <li data-name="Collection#isCapped"><a href="Collection.html#isCapped">isCapped</a></li>
            
                <li data-name="Collection#listIndexes"><a href="Collection.html#listIndexes">listIndexes</a></li>
            
                <li data-name="Collection#mapReduce"><a href="Collection.html#mapReduce">mapReduce</a></li>
            
                <li data-name="Collection#options"><a href="Collection.html#options">options</a></li>
            
                <li data-name="Collection#parallelCollectionScan"><a href="Collection.html#parallelCollectionScan">parallelCollectionScan</a></li>
            
                <li data-name="Collection#reIndex"><a href="Collection.html#reIndex">reIndex</a></li>
            
                <li data-name="Collection#remove"><a href="Collection.html#remove">remove</a></li>
            
                <li data-name="Collection#rename"><a href="Collection.html#rename">rename</a></li>
            
                <li data-name="Collection#replaceOne"><a href="Collection.html#replaceOne">replaceOne</a></li>
            
                <li data-name="Collection#save"><a href="Collection.html#save">save</a></li>
            
                <li data-name="Collection#stats"><a href="Collection.html#stats">stats</a></li>
            
                <li data-name="Collection#update"><a href="Collection.html#update">update</a></li>
            
                <li data-name="Collection#updateMany"><a href="Collection.html#updateMany">updateMany</a></li>
            
                <li data-name="Collection#updateOne"><a href="Collection.html#updateOne">updateOne</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="CommandCursor">
            <span class="title">
                <a href="CommandCursor.html">CommandCursor</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            <span class="subtitle">Typedefs</span>
            
                <li data-name="CommandCursor~endCallback"><a href="CommandCursor.html#~endCallback">endCallback</a></li>
            
                <li data-name="CommandCursor~iteratorCallback"><a href="CommandCursor.html#~iteratorCallback">iteratorCallback</a></li>
            
                <li data-name="CommandCursor~resultCallback"><a href="CommandCursor.html#~resultCallback">resultCallback</a></li>
            
                <li data-name="CommandCursor~toArrayResultCallback"><a href="CommandCursor.html#~toArrayResultCallback">toArrayResultCallback</a></li>
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="CommandCursor#batchSize"><a href="CommandCursor.html#batchSize">batchSize</a></li>
            
                <li data-name="CommandCursor#clone"><a href="CommandCursor.html#clone">clone</a></li>
            
                <li data-name="CommandCursor#close"><a href="CommandCursor.html#close">close</a></li>
            
                <li data-name="CommandCursor#each"><a href="CommandCursor.html#each">each</a></li>
            
                <li data-name="CommandCursor#hasNext"><a href="CommandCursor.html#hasNext">hasNext</a></li>
            
                <li data-name="CommandCursor#isClosed"><a href="CommandCursor.html#isClosed">isClosed</a></li>
            
                <li data-name="CommandCursor#maxTimeMS"><a href="CommandCursor.html#maxTimeMS">maxTimeMS</a></li>
            
                <li data-name="CommandCursor#next"><a href="CommandCursor.html#next">next</a></li>
            
                <li data-name="CommandCursor#pause"><a href="CommandCursor.html#pause">pause</a></li>
            
                <li data-name="CommandCursor#pipe"><a href="CommandCursor.html#pipe">pipe</a></li>
            
                <li data-name="CommandCursor#read"><a href="CommandCursor.html#read">read</a></li>
            
                <li data-name="CommandCursor#resume"><a href="CommandCursor.html#resume">resume</a></li>
            
                <li data-name="CommandCursor#rewind"><a href="CommandCursor.html#rewind">rewind</a></li>
            
                <li data-name="CommandCursor#setEncoding"><a href="CommandCursor.html#setEncoding">setEncoding</a></li>
            
                <li data-name="CommandCursor#setReadPreference"><a href="CommandCursor.html#setReadPreference">setReadPreference</a></li>
            
                <li data-name="CommandCursor#toArray"><a href="CommandCursor.html#toArray">toArray</a></li>
            
                <li data-name="CommandCursor#unpipe"><a href="CommandCursor.html#unpipe">unpipe</a></li>
            
                <li data-name="CommandCursor#unshift"><a href="CommandCursor.html#unshift">unshift</a></li>
            
                <li data-name="CommandCursor#wrap"><a href="CommandCursor.html#wrap">wrap</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            <span class="subtitle">Events</span>
            
                <li data-name="CommandCursor#event:close"><a href="CommandCursor.html#event:close">close</a></li>
            
                <li data-name="CommandCursor#event:data"><a href="CommandCursor.html#event:data">data</a></li>
            
                <li data-name="CommandCursor#event:end"><a href="CommandCursor.html#event:end">end</a></li>
            
                <li data-name="CommandCursor#event:readable"><a href="CommandCursor.html#event:readable">readable</a></li>
            
            </ul>
        </li>
    
        <li class="item" data-name="Cursor">
            <span class="title">
                <a href="Cursor.html">Cursor</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            <span class="subtitle">Typedefs</span>
            
                <li data-name="Cursor~countResultCallback"><a href="Cursor.html#~countResultCallback">countResultCallback</a></li>
            
                <li data-name="Cursor~endCallback"><a href="Cursor.html#~endCallback">endCallback</a></li>
            
                <li data-name="Cursor~iteratorCallback"><a href="Cursor.html#~iteratorCallback">iteratorCallback</a></li>
            
                <li data-name="Cursor~resultCallback"><a href="Cursor.html#~resultCallback">resultCallback</a></li>
            
                <li data-name="Cursor~toArrayResultCallback"><a href="Cursor.html#~toArrayResultCallback">toArrayResultCallback</a></li>
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="Cursor#addCursorFlag"><a href="Cursor.html#addCursorFlag">addCursorFlag</a></li>
            
                <li data-name="Cursor#addQueryModifier"><a href="Cursor.html#addQueryModifier">addQueryModifier</a></li>
            
                <li data-name="Cursor#batchSize"><a href="Cursor.html#batchSize">batchSize</a></li>
            
                <li data-name="Cursor#clone"><a href="Cursor.html#clone">clone</a></li>
            
                <li data-name="Cursor#close"><a href="Cursor.html#close">close</a></li>
            
                <li data-name="Cursor#collation"><a href="Cursor.html#collation">collation</a></li>
            
                <li data-name="Cursor#comment"><a href="Cursor.html#comment">comment</a></li>
            
                <li data-name="Cursor#count"><a href="Cursor.html#count">count</a></li>
            
                <li data-name="Cursor#each"><a href="Cursor.html#each">each</a></li>
            
                <li data-name="Cursor#explain"><a href="Cursor.html#explain">explain</a></li>
            
                <li data-name="Cursor#filter"><a href="Cursor.html#filter">filter</a></li>
            
                <li data-name="Cursor#forEach"><a href="Cursor.html#forEach">forEach</a></li>
            
                <li data-name="Cursor#hasNext"><a href="Cursor.html#hasNext">hasNext</a></li>
            
                <li data-name="Cursor#hint"><a href="Cursor.html#hint">hint</a></li>
            
                <li data-name="Cursor#isClosed"><a href="Cursor.html#isClosed">isClosed</a></li>
            
                <li data-name="Cursor#limit"><a href="Cursor.html#limit">limit</a></li>
            
                <li data-name="Cursor#map"><a href="Cursor.html#map">map</a></li>
            
                <li data-name="Cursor#max"><a href="Cursor.html#max">max</a></li>
            
                <li data-name="Cursor#maxAwaitTimeMS"><a href="Cursor.html#maxAwaitTimeMS">maxAwaitTimeMS</a></li>
            
                <li data-name="Cursor#maxScan"><a href="Cursor.html#maxScan">maxScan</a></li>
            
                <li data-name="Cursor#maxTimeMS"><a href="Cursor.html#maxTimeMS">maxTimeMS</a></li>
            
                <li data-name="Cursor#min"><a href="Cursor.html#min">min</a></li>
            
                <li data-name="Cursor#next"><a href="Cursor.html#next">next</a></li>
            
                <li data-name="Cursor#nextObject"><a href="Cursor.html#nextObject">nextObject</a></li>
            
                <li data-name="Cursor#pause"><a href="Cursor.html#pause">pause</a></li>
            
                <li data-name="Cursor#pipe"><a href="Cursor.html#pipe">pipe</a></li>
            
                <li data-name="Cursor#project"><a href="Cursor.html#project">project</a></li>
            
                <li data-name="Cursor#read"><a href="Cursor.html#read">read</a></li>
            
                <li data-name="Cursor#resume"><a href="Cursor.html#resume">resume</a></li>
            
                <li data-name="Cursor#returnKey"><a href="Cursor.html#returnKey">returnKey</a></li>
            
                <li data-name="Cursor#rewind"><a href="Cursor.html#rewind">rewind</a></li>
            
                <li data-name="Cursor#setCursorOption"><a href="Cursor.html#setCursorOption">setCursorOption</a></li>
            
                <li data-name="Cursor#setEncoding"><a href="Cursor.html#setEncoding">setEncoding</a></li>
            
                <li data-name="Cursor#setReadPreference"><a href="Cursor.html#setReadPreference">setReadPreference</a></li>
            
                <li data-name="Cursor#showRecordId"><a href="Cursor.html#showRecordId">showRecordId</a></li>
            
                <li data-name="Cursor#skip"><a href="Cursor.html#skip">skip</a></li>
            
                <li data-name="Cursor#snapshot"><a href="Cursor.html#snapshot">snapshot</a></li>
            
                <li data-name="Cursor#sort"><a href="Cursor.html#sort">sort</a></li>
            
                <li data-name="Cursor#stream"><a href="Cursor.html#stream">stream</a></li>
            
                <li data-name="Cursor#toArray"><a href="Cursor.html#toArray">toArray</a></li>
            
                <li data-name="Cursor#unpipe"><a href="Cursor.html#unpipe">unpipe</a></li>
            
                <li data-name="Cursor#unshift"><a href="Cursor.html#unshift">unshift</a></li>
            
                <li data-name="Cursor#wrap"><a href="Cursor.html#wrap">wrap</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            <span class="subtitle">Events</span>
            
                <li data-name="Cursor#event:close"><a href="Cursor.html#event:close">close</a></li>
            
                <li data-name="Cursor#event:data"><a href="Cursor.html#event:data">data</a></li>
            
                <li data-name="Cursor#event:end"><a href="Cursor.html#event:end">end</a></li>
            
                <li data-name="Cursor#event:readable"><a href="Cursor.html#event:readable">readable</a></li>
            
            </ul>
        </li>
    
        <li class="item" data-name="Db">
            <span class="title">
                <a href="Db.html">Db</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            <span class="subtitle">Typedefs</span>
            
                <li data-name="Db~collectionResultCallback"><a href="Db.html#~collectionResultCallback">collectionResultCallback</a></li>
            
                <li data-name="Db~collectionsResultCallback"><a href="Db.html#~collectionsResultCallback">collectionsResultCallback</a></li>
            
                <li data-name="Db~noResultCallback"><a href="Db.html#~noResultCallback">noResultCallback</a></li>
            
                <li data-name="Db~openCallback"><a href="Db.html#~openCallback">openCallback</a></li>
            
                <li data-name="Db~resultCallback"><a href="Db.html#~resultCallback">resultCallback</a></li>
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="Db#addUser"><a href="Db.html#addUser">addUser</a></li>
            
                <li data-name="Db#admin"><a href="Db.html#admin">admin</a></li>
            
                <li data-name="Db#authenticate"><a href="Db.html#authenticate">authenticate</a></li>
            
                <li data-name="Db#close"><a href="Db.html#close">close</a></li>
            
                <li data-name="Db#collection"><a href="Db.html#collection">collection</a></li>
            
                <li data-name="Db#collections"><a href="Db.html#collections">collections</a></li>
            
                <li data-name="Db#command"><a href="Db.html#command">command</a></li>
            
                <li data-name="Db#createCollection"><a href="Db.html#createCollection">createCollection</a></li>
            
                <li data-name="Db#createIndex"><a href="Db.html#createIndex">createIndex</a></li>
            
                <li data-name="Db#db"><a href="Db.html#db">db</a></li>
            
                <li data-name="Db#dropCollection"><a href="Db.html#dropCollection">dropCollection</a></li>
            
                <li data-name="Db#dropDatabase"><a href="Db.html#dropDatabase">dropDatabase</a></li>
            
                <li data-name="Db#ensureIndex"><a href="Db.html#ensureIndex">ensureIndex</a></li>
            
                <li data-name="Db#eval"><a href="Db.html#eval">eval</a></li>
            
                <li data-name="Db#executeDbAdminCommand"><a href="Db.html#executeDbAdminCommand">executeDbAdminCommand</a></li>
            
                <li data-name="Db#indexInformation"><a href="Db.html#indexInformation">indexInformation</a></li>
            
                <li data-name="Db#listCollections"><a href="Db.html#listCollections">listCollections</a></li>
            
                <li data-name="Db#logout"><a href="Db.html#logout">logout</a></li>
            
                <li data-name="Db#open"><a href="Db.html#open">open</a></li>
            
                <li data-name="Db#removeUser"><a href="Db.html#removeUser">removeUser</a></li>
            
                <li data-name="Db#renameCollection"><a href="Db.html#renameCollection">renameCollection</a></li>
            
                <li data-name="Db#stats"><a href="Db.html#stats">stats</a></li>
            
                <li data-name="Db#unref"><a href="Db.html#unref">unref</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            <span class="subtitle">Events</span>
            
                <li data-name="Db#event:authenticated"><a href="Db.html#event:authenticated">authenticated</a></li>
            
                <li data-name="Db#event:close"><a href="Db.html#event:close">close</a></li>
            
                <li data-name="Db#event:error"><a href="Db.html#event:error">error</a></li>
            
                <li data-name="Db#event:fullsetup"><a href="Db.html#event:fullsetup">fullsetup</a></li>
            
                <li data-name="Db#event:parseError"><a href="Db.html#event:parseError">parseError</a></li>
            
                <li data-name="Db#event:reconnect"><a href="Db.html#event:reconnect">reconnect</a></li>
            
                <li data-name="Db#event:timeout"><a href="Db.html#event:timeout">timeout</a></li>
            
            </ul>
        </li>
    
        <li class="item" data-name="DBRef">
            <span class="title">
                <a href="DBRef.html">DBRef</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="Decimal128">
            <span class="title">
                <a href="Decimal128.html">Decimal128</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="Decimal128#toString"><a href="Decimal128.html#toString">toString</a></li>
            
                <li data-name="Decimal128.fromString"><a href="Decimal128.html#.fromString">fromString</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="Double">
            <span class="title">
                <a href="Double.html">Double</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="Double#valueOf"><a href="Double.html#valueOf">valueOf</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="FindOperatorsOrdered">
            <span class="title">
                <a href="FindOperatorsOrdered.html">FindOperatorsOrdered</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="FindOperatorsOrdered#delete"><a href="FindOperatorsOrdered.html#delete">delete</a></li>
            
                <li data-name="FindOperatorsOrdered#deleteOne"><a href="FindOperatorsOrdered.html#deleteOne">deleteOne</a></li>
            
                <li data-name="FindOperatorsOrdered#replaceOne"><a href="FindOperatorsOrdered.html#replaceOne">replaceOne</a></li>
            
                <li data-name="FindOperatorsOrdered#update"><a href="FindOperatorsOrdered.html#update">update</a></li>
            
                <li data-name="FindOperatorsOrdered#updateOne"><a href="FindOperatorsOrdered.html#updateOne">updateOne</a></li>
            
                <li data-name="FindOperatorsOrdered#upsert"><a href="FindOperatorsOrdered.html#upsert">upsert</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="FindOperatorsUnordered">
            <span class="title">
                <a href="FindOperatorsUnordered.html">FindOperatorsUnordered</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="FindOperatorsUnordered#remove"><a href="FindOperatorsUnordered.html#remove">remove</a></li>
            
                <li data-name="FindOperatorsUnordered#removeOne"><a href="FindOperatorsUnordered.html#removeOne">removeOne</a></li>
            
                <li data-name="FindOperatorsUnordered#replaceOne"><a href="FindOperatorsUnordered.html#replaceOne">replaceOne</a></li>
            
                <li data-name="FindOperatorsUnordered#update"><a href="FindOperatorsUnordered.html#update">update</a></li>
            
                <li data-name="FindOperatorsUnordered#updateOne"><a href="FindOperatorsUnordered.html#updateOne">updateOne</a></li>
            
                <li data-name="FindOperatorsUnordered#upsert"><a href="FindOperatorsUnordered.html#upsert">upsert</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="GridFSBucket">
            <span class="title">
                <a href="GridFSBucket.html">GridFSBucket</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            <span class="subtitle">Typedefs</span>
            
                <li data-name="GridFSBucket~errorCallback"><a href="GridFSBucket.html#~errorCallback">errorCallback</a></li>
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="GridFSBucket#delete"><a href="GridFSBucket.html#delete">delete</a></li>
            
                <li data-name="GridFSBucket#drop"><a href="GridFSBucket.html#drop">drop</a></li>
            
                <li data-name="GridFSBucket#find"><a href="GridFSBucket.html#find">find</a></li>
            
                <li data-name="GridFSBucket#openDownloadStream"><a href="GridFSBucket.html#openDownloadStream">openDownloadStream</a></li>
            
                <li data-name="GridFSBucket#openDownloadStreamByName"><a href="GridFSBucket.html#openDownloadStreamByName">openDownloadStreamByName</a></li>
            
                <li data-name="GridFSBucket#openUploadStream"><a href="GridFSBucket.html#openUploadStream">openUploadStream</a></li>
            
                <li data-name="GridFSBucket#openUploadStreamWithId"><a href="GridFSBucket.html#openUploadStreamWithId">openUploadStreamWithId</a></li>
            
                <li data-name="GridFSBucket#rename"><a href="GridFSBucket.html#rename">rename</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            <span class="subtitle">Events</span>
            
                <li data-name="GridFSBucket#event:index"><a href="GridFSBucket.html#event:index">index</a></li>
            
            </ul>
        </li>
    
        <li class="item" data-name="GridFSBucketReadStream">
            <span class="title">
                <a href="GridFSBucketReadStream.html">GridFSBucketReadStream</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="GridFSBucketReadStream#_read"><a href="GridFSBucketReadStream.html#_read">_read</a></li>
            
                <li data-name="GridFSBucketReadStream#abort"><a href="GridFSBucketReadStream.html#abort">abort</a></li>
            
                <li data-name="GridFSBucketReadStream#end"><a href="GridFSBucketReadStream.html#end">end</a></li>
            
                <li data-name="GridFSBucketReadStream#start"><a href="GridFSBucketReadStream.html#start">start</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            <span class="subtitle">Events</span>
            
                <li data-name="GridFSBucketReadStream#event:close"><a href="GridFSBucketReadStream.html#event:close">close</a></li>
            
                <li data-name="GridFSBucketReadStream#event:data"><a href="GridFSBucketReadStream.html#event:data">data</a></li>
            
                <li data-name="GridFSBucketReadStream#event:end"><a href="GridFSBucketReadStream.html#event:end">end</a></li>
            
                <li data-name="GridFSBucketReadStream#event:error"><a href="GridFSBucketReadStream.html#event:error">error</a></li>
            
                <li data-name="GridFSBucketReadStream#event:file"><a href="GridFSBucketReadStream.html#event:file">file</a></li>
            
            </ul>
        </li>
    
        <li class="item" data-name="GridFSBucketWriteStream">
            <span class="title">
                <a href="GridFSBucketWriteStream.html">GridFSBucketWriteStream</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="GridFSBucketWriteStream#abort"><a href="GridFSBucketWriteStream.html#abort">abort</a></li>
            
                <li data-name="GridFSBucketWriteStream#end"><a href="GridFSBucketWriteStream.html#end">end</a></li>
            
                <li data-name="GridFSBucketWriteStream#write"><a href="GridFSBucketWriteStream.html#write">write</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            <span class="subtitle">Events</span>
            
                <li data-name="GridFSBucketWriteStream#event:error"><a href="GridFSBucketWriteStream.html#event:error">error</a></li>
            
                <li data-name="GridFSBucketWriteStream#event:finish"><a href="GridFSBucketWriteStream.html#event:finish">finish</a></li>
            
            </ul>
        </li>
    
        <li class="item" data-name="GridStore">
            <span class="title">
                <a href="GridStore.html">GridStore</a>
                
            </span>
            <ul class="members itemMembers">
            
            <span class="subtitle">Members</span>
            
                <li data-name="GridStore.DEFAULT_CONTENT_TYPE"><a href="GridStore.html#.DEFAULT_CONTENT_TYPE">DEFAULT_CONTENT_TYPE</a></li>
            
                <li data-name="GridStore.DEFAULT_ROOT_COLLECTION"><a href="GridStore.html#.DEFAULT_ROOT_COLLECTION">DEFAULT_ROOT_COLLECTION</a></li>
            
                <li data-name="GridStore.IO_SEEK_CUR"><a href="GridStore.html#.IO_SEEK_CUR">IO_SEEK_CUR</a></li>
            
                <li data-name="GridStore.IO_SEEK_END"><a href="GridStore.html#.IO_SEEK_END">IO_SEEK_END</a></li>
            
                <li data-name="GridStore.IO_SEEK_SET"><a href="GridStore.html#.IO_SEEK_SET">IO_SEEK_SET</a></li>
            
            </ul>
            <ul class="typedefs itemMembers">
            
            <span class="subtitle">Typedefs</span>
            
                <li data-name="GridStore~collectionCallback"><a href="GridStore.html#~collectionCallback">collectionCallback</a></li>
            
                <li data-name="GridStore~gridStoreCallback"><a href="GridStore.html#~gridStoreCallback">gridStoreCallback</a></li>
            
                <li data-name="GridStore~openCallback"><a href="GridStore.html#~openCallback">openCallback</a></li>
            
                <li data-name="GridStore~readCallback"><a href="GridStore.html#~readCallback">readCallback</a></li>
            
                <li data-name="GridStore~readlinesCallback"><a href="GridStore.html#~readlinesCallback">readlinesCallback</a></li>
            
                <li data-name="GridStore~resultCallback"><a href="GridStore.html#~resultCallback">resultCallback</a></li>
            
                <li data-name="GridStore~tellCallback"><a href="GridStore.html#~tellCallback">tellCallback</a></li>
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="GridStore.exist"><a href="GridStore.html#.exist">exist</a></li>
            
                <li data-name="GridStore.list"><a href="GridStore.html#.list">list</a></li>
            
                <li data-name="GridStore.read"><a href="GridStore.html#.read">read</a></li>
            
                <li data-name="GridStore.readlines"><a href="GridStore.html#.readlines">readlines</a></li>
            
                <li data-name="GridStore.unlink"><a href="GridStore.html#.unlink">unlink</a></li>
            
                <li data-name="GridStore#chunkCollection"><a href="GridStore.html#chunkCollection">chunkCollection</a></li>
            
                <li data-name="GridStore#close"><a href="GridStore.html#close">close</a></li>
            
                <li data-name="GridStore#collection"><a href="GridStore.html#collection">collection</a></li>
            
                <li data-name="GridStore#destroy"><a href="GridStore.html#destroy">destroy</a></li>
            
                <li data-name="GridStore#eof"><a href="GridStore.html#eof">eof</a></li>
            
                <li data-name="GridStore#getc"><a href="GridStore.html#getc">getc</a></li>
            
                <li data-name="GridStore#open"><a href="GridStore.html#open">open</a></li>
            
                <li data-name="GridStore#puts"><a href="GridStore.html#puts">puts</a></li>
            
                <li data-name="GridStore#read"><a href="GridStore.html#read">read</a></li>
            
                <li data-name="GridStore#readlines"><a href="GridStore.html#readlines">readlines</a></li>
            
                <li data-name="GridStore#rewind"><a href="GridStore.html#rewind">rewind</a></li>
            
                <li data-name="GridStore#seek"><a href="GridStore.html#seek">seek</a></li>
            
                <li data-name="GridStore#stream"><a href="GridStore.html#stream">stream</a></li>
            
                <li data-name="GridStore#tell"><a href="GridStore.html#tell">tell</a></li>
            
                <li data-name="GridStore#unlink"><a href="GridStore.html#unlink">unlink</a></li>
            
                <li data-name="GridStore#write"><a href="GridStore.html#write">write</a></li>
            
                <li data-name="GridStore#writeFile"><a href="GridStore.html#writeFile">writeFile</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="GridStoreStream">
            <span class="title">
                <a href="GridStoreStream.html">GridStoreStream</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="GridStoreStream#end"><a href="GridStoreStream.html#end">end</a></li>
            
                <li data-name="GridStoreStream#pause"><a href="GridStoreStream.html#pause">pause</a></li>
            
                <li data-name="GridStoreStream#pipe"><a href="GridStoreStream.html#pipe">pipe</a></li>
            
                <li data-name="GridStoreStream#read"><a href="GridStoreStream.html#read">read</a></li>
            
                <li data-name="GridStoreStream#resume"><a href="GridStoreStream.html#resume">resume</a></li>
            
                <li data-name="GridStoreStream#setEncoding"><a href="GridStoreStream.html#setEncoding">setEncoding</a></li>
            
                <li data-name="GridStoreStream#unpipe"><a href="GridStoreStream.html#unpipe">unpipe</a></li>
            
                <li data-name="GridStoreStream#unshift"><a href="GridStoreStream.html#unshift">unshift</a></li>
            
                <li data-name="GridStoreStream#wrap"><a href="GridStoreStream.html#wrap">wrap</a></li>
            
                <li data-name="GridStoreStream#write"><a href="GridStoreStream.html#write">write</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            <span class="subtitle">Events</span>
            
                <li data-name="GridStoreStream#event:close"><a href="GridStoreStream.html#event:close">close</a></li>
            
                <li data-name="GridStoreStream#event:data"><a href="GridStoreStream.html#event:data">data</a></li>
            
                <li data-name="GridStoreStream#event:drain"><a href="GridStoreStream.html#event:drain">drain</a></li>
            
                <li data-name="GridStoreStream#event:end"><a href="GridStoreStream.html#event:end">end</a></li>
            
                <li data-name="GridStoreStream#event:error"><a href="GridStoreStream.html#event:error">error</a></li>
            
                <li data-name="GridStoreStream#event:finish"><a href="GridStoreStream.html#event:finish">finish</a></li>
            
                <li data-name="GridStoreStream#event:pipe"><a href="GridStoreStream.html#event:pipe">pipe</a></li>
            
                <li data-name="GridStoreStream#event:readable"><a href="GridStoreStream.html#event:readable">readable</a></li>
            
                <li data-name="GridStoreStream#event:unpipe"><a href="GridStoreStream.html#event:unpipe">unpipe</a></li>
            
            </ul>
        </li>
    
        <li class="item" data-name="Int32">
            <span class="title">
                <a href="Int32.html">Int32</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="Int32#valueOf"><a href="Int32.html#valueOf">valueOf</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="Logger">
            <span class="title">
                <a href="Logger.html">Logger</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="Logger.currentLogger"><a href="Logger.html#.currentLogger">currentLogger</a></li>
            
                <li data-name="Logger.filter"><a href="Logger.html#.filter">filter</a></li>
            
                <li data-name="Logger.reset"><a href="Logger.html#.reset">reset</a></li>
            
                <li data-name="Logger.setCurrentLogger"><a href="Logger.html#.setCurrentLogger">setCurrentLogger</a></li>
            
                <li data-name="Logger.setLevel"><a href="Logger.html#.setLevel">setLevel</a></li>
            
                <li data-name="Logger#debug"><a href="Logger.html#debug">debug</a></li>
            
                <li data-name="Logger#error"><a href="Logger.html#error">error</a></li>
            
                <li data-name="Logger#info"><a href="Logger.html#info">info</a></li>
            
                <li data-name="Logger#isDebug"><a href="Logger.html#isDebug">isDebug</a></li>
            
                <li data-name="Logger#isError"><a href="Logger.html#isError">isError</a></li>
            
                <li data-name="Logger#isInfo"><a href="Logger.html#isInfo">isInfo</a></li>
            
                <li data-name="Logger#isWarn"><a href="Logger.html#isWarn">isWarn</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="Long">
            <span class="title">
                <a href="Long.html">Long</a>
                
            </span>
            <ul class="members itemMembers">
            
            <span class="subtitle">Members</span>
            
                <li data-name="Long.MAX_VALUE"><a href="Long.html#.MAX_VALUE">MAX_VALUE</a></li>
            
                <li data-name="Long.MIN_VALUE"><a href="Long.html#.MIN_VALUE">MIN_VALUE</a></li>
            
                <li data-name="Long.NEG_ONE"><a href="Long.html#.NEG_ONE">NEG_ONE</a></li>
            
                <li data-name="Long.ONE"><a href="Long.html#.ONE">ONE</a></li>
            
                <li data-name="Long.ZERO"><a href="Long.html#.ZERO">ZERO</a></li>
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="Long.fromBits"><a href="Long.html#.fromBits">fromBits</a></li>
            
                <li data-name="Long.fromInt"><a href="Long.html#.fromInt">fromInt</a></li>
            
                <li data-name="Long.fromNumber"><a href="Long.html#.fromNumber">fromNumber</a></li>
            
                <li data-name="Long.fromString"><a href="Long.html#.fromString">fromString</a></li>
            
                <li data-name="Long#add"><a href="Long.html#add">add</a></li>
            
                <li data-name="Long#and"><a href="Long.html#and">and</a></li>
            
                <li data-name="Long#compare"><a href="Long.html#compare">compare</a></li>
            
                <li data-name="Long#div"><a href="Long.html#div">div</a></li>
            
                <li data-name="Long#equals"><a href="Long.html#equals">equals</a></li>
            
                <li data-name="Long#getHighBits"><a href="Long.html#getHighBits">getHighBits</a></li>
            
                <li data-name="Long#getLowBits"><a href="Long.html#getLowBits">getLowBits</a></li>
            
                <li data-name="Long#getLowBitsUnsigned"><a href="Long.html#getLowBitsUnsigned">getLowBitsUnsigned</a></li>
            
                <li data-name="Long#getNumBitsAbs"><a href="Long.html#getNumBitsAbs">getNumBitsAbs</a></li>
            
                <li data-name="Long#greaterThan"><a href="Long.html#greaterThan">greaterThan</a></li>
            
                <li data-name="Long#greaterThanOrEqual"><a href="Long.html#greaterThanOrEqual">greaterThanOrEqual</a></li>
            
                <li data-name="Long#isNegative"><a href="Long.html#isNegative">isNegative</a></li>
            
                <li data-name="Long#isOdd"><a href="Long.html#isOdd">isOdd</a></li>
            
                <li data-name="Long#isZero"><a href="Long.html#isZero">isZero</a></li>
            
                <li data-name="Long#lessThan"><a href="Long.html#lessThan">lessThan</a></li>
            
                <li data-name="Long#lessThanOrEqual"><a href="Long.html#lessThanOrEqual">lessThanOrEqual</a></li>
            
                <li data-name="Long#modulo"><a href="Long.html#modulo">modulo</a></li>
            
                <li data-name="Long#multiply"><a href="Long.html#multiply">multiply</a></li>
            
                <li data-name="Long#negate"><a href="Long.html#negate">negate</a></li>
            
                <li data-name="Long#not"><a href="Long.html#not">not</a></li>
            
                <li data-name="Long#notEquals"><a href="Long.html#notEquals">notEquals</a></li>
            
                <li data-name="Long#or"><a href="Long.html#or">or</a></li>
            
                <li data-name="Long#shiftLeft"><a href="Long.html#shiftLeft">shiftLeft</a></li>
            
                <li data-name="Long#shiftRight"><a href="Long.html#shiftRight">shiftRight</a></li>
            
                <li data-name="Long#shiftRightUnsigned"><a href="Long.html#shiftRightUnsigned">shiftRightUnsigned</a></li>
            
                <li data-name="Long#subtract"><a href="Long.html#subtract">subtract</a></li>
            
                <li data-name="Long#toInt"><a href="Long.html#toInt">toInt</a></li>
            
                <li data-name="Long#toJSON"><a href="Long.html#toJSON">toJSON</a></li>
            
                <li data-name="Long#toNumber"><a href="Long.html#toNumber">toNumber</a></li>
            
                <li data-name="Long#toString"><a href="Long.html#toString">toString</a></li>
            
                <li data-name="Long#xor"><a href="Long.html#xor">xor</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="MaxKey">
            <span class="title">
                <a href="MaxKey.html">MaxKey</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="MinKey">
            <span class="title">
                <a href="MinKey.html">MinKey</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="MongoClient">
            <span class="title">
                <a href="MongoClient.html">MongoClient</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            <span class="subtitle">Typedefs</span>
            
                <li data-name="MongoClient~connectCallback"><a href="MongoClient.html#~connectCallback">connectCallback</a></li>
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="MongoClient.connect"><a href="MongoClient.html#.connect">connect</a></li>
            
                <li data-name="MongoClient#connect"><a href="MongoClient.html#connect">connect</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="MongoError">
            <span class="title">
                <a href="MongoError.html">MongoError</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="MongoError.create"><a href="MongoError.html#.create">create</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="Mongos">
            <span class="title">
                <a href="Mongos.html">Mongos</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="Mongos#connections"><a href="Mongos.html#connections">connections</a></li>
            
                <li data-name="Mongos#unref"><a href="Mongos.html#unref">unref</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            <span class="subtitle">Events</span>
            
                <li data-name="Mongos#event:close"><a href="Mongos.html#event:close">close</a></li>
            
                <li data-name="Mongos#event:connect"><a href="Mongos.html#event:connect">connect</a></li>
            
                <li data-name="Mongos#event:error"><a href="Mongos.html#event:error">error</a></li>
            
                <li data-name="Mongos#event:fullsetup"><a href="Mongos.html#event:fullsetup">fullsetup</a></li>
            
                <li data-name="Mongos#event:ha"><a href="Mongos.html#event:ha">ha</a></li>
            
                <li data-name="Mongos#event:joined"><a href="Mongos.html#event:joined">joined</a></li>
            
                <li data-name="Mongos#event:left"><a href="Mongos.html#event:left">left</a></li>
            
                <li data-name="Mongos#event:open"><a href="Mongos.html#event:open">open</a></li>
            
                <li data-name="Mongos#event:parseError"><a href="Mongos.html#event:parseError">parseError</a></li>
            
                <li data-name="Mongos#event:timeout"><a href="Mongos.html#event:timeout">timeout</a></li>
            
            </ul>
        </li>
    
        <li class="item" data-name="ObjectID">
            <span class="title">
                <a href="ObjectID.html">ObjectID</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="ObjectID.createFromHexString"><a href="ObjectID.html#.createFromHexString">createFromHexString</a></li>
            
                <li data-name="ObjectID.createFromTime"><a href="ObjectID.html#.createFromTime">createFromTime</a></li>
            
                <li data-name="ObjectID.isValid"><a href="ObjectID.html#.isValid">isValid</a></li>
            
                <li data-name="ObjectID#equals"><a href="ObjectID.html#equals">equals</a></li>
            
                <li data-name="ObjectID#generate"><a href="ObjectID.html#generate">generate</a></li>
            
                <li data-name="ObjectID#getTimestamp"><a href="ObjectID.html#getTimestamp">getTimestamp</a></li>
            
                <li data-name="ObjectID#toHexString"><a href="ObjectID.html#toHexString">toHexString</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="OrderedBulkOperation">
            <span class="title">
                <a href="OrderedBulkOperation.html">OrderedBulkOperation</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            <span class="subtitle">Typedefs</span>
            
                <li data-name="OrderedBulkOperation~resultCallback"><a href="OrderedBulkOperation.html#~resultCallback">resultCallback</a></li>
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="OrderedBulkOperation#execute"><a href="OrderedBulkOperation.html#execute">execute</a></li>
            
                <li data-name="OrderedBulkOperation#find"><a href="OrderedBulkOperation.html#find">find</a></li>
            
                <li data-name="OrderedBulkOperation#insert"><a href="OrderedBulkOperation.html#insert">insert</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="ReadPreference">
            <span class="title">
                <a href="ReadPreference.html">ReadPreference</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="ReadPreference.isValid"><a href="ReadPreference.html#.isValid">isValid</a></li>
            
                <li data-name="ReadPreference#isValid"><a href="ReadPreference.html#isValid">isValid</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="ReplSet">
            <span class="title">
                <a href="ReplSet.html">ReplSet</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="ReplSet#connections"><a href="ReplSet.html#connections">connections</a></li>
            
                <li data-name="ReplSet#unref"><a href="ReplSet.html#unref">unref</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            <span class="subtitle">Events</span>
            
                <li data-name="ReplSet#event:close"><a href="ReplSet.html#event:close">close</a></li>
            
                <li data-name="ReplSet#event:connect"><a href="ReplSet.html#event:connect">connect</a></li>
            
                <li data-name="ReplSet#event:error"><a href="ReplSet.html#event:error">error</a></li>
            
                <li data-name="ReplSet#event:fullsetup"><a href="ReplSet.html#event:fullsetup">fullsetup</a></li>
            
                <li data-name="ReplSet#event:ha"><a href="ReplSet.html#event:ha">ha</a></li>
            
                <li data-name="ReplSet#event:joined"><a href="ReplSet.html#event:joined">joined</a></li>
            
                <li data-name="ReplSet#event:left"><a href="ReplSet.html#event:left">left</a></li>
            
                <li data-name="ReplSet#event:open"><a href="ReplSet.html#event:open">open</a></li>
            
                <li data-name="ReplSet#event:parseError"><a href="ReplSet.html#event:parseError">parseError</a></li>
            
                <li data-name="ReplSet#event:timeout"><a href="ReplSet.html#event:timeout">timeout</a></li>
            
            </ul>
        </li>
    
        <li class="item" data-name="Server">
            <span class="title">
                <a href="Server.html">Server</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="Server#connections"><a href="Server.html#connections">connections</a></li>
            
                <li data-name="Server#unref"><a href="Server.html#unref">unref</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            <span class="subtitle">Events</span>
            
                <li data-name="Server#event:close"><a href="Server.html#event:close">close</a></li>
            
                <li data-name="Server#event:connect"><a href="Server.html#event:connect">connect</a></li>
            
                <li data-name="Server#event:error"><a href="Server.html#event:error">error</a></li>
            
                <li data-name="Server#event:parseError"><a href="Server.html#event:parseError">parseError</a></li>
            
                <li data-name="Server#event:reconnect"><a href="Server.html#event:reconnect">reconnect</a></li>
            
                <li data-name="Server#event:timeout"><a href="Server.html#event:timeout">timeout</a></li>
            
            </ul>
        </li>
    
        <li class="item" data-name="Symbol">
            <span class="title">
                <a href="Symbol.html">Symbol</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="Symbol#valueOf"><a href="Symbol.html#valueOf">valueOf</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="Timestamp">
            <span class="title">
                <a href="Timestamp.html">Timestamp</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="Timestamp#toJSON"><a href="Timestamp.html#toJSON">toJSON</a></li>
            
                <li data-name="Timestamp.fromBits"><a href="Timestamp.html#.fromBits">fromBits</a></li>
            
                <li data-name="Timestamp.fromInt"><a href="Timestamp.html#.fromInt">fromInt</a></li>
            
                <li data-name="Timestamp.fromNumber"><a href="Timestamp.html#.fromNumber">fromNumber</a></li>
            
                <li data-name="Timestamp.fromString"><a href="Timestamp.html#.fromString">fromString</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="UnorderedBulkOperation">
            <span class="title">
                <a href="UnorderedBulkOperation.html">UnorderedBulkOperation</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            <span class="subtitle">Typedefs</span>
            
                <li data-name="UnorderedBulkOperation~resultCallback"><a href="UnorderedBulkOperation.html#~resultCallback">resultCallback</a></li>
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="UnorderedBulkOperation#execute"><a href="UnorderedBulkOperation.html#execute">execute</a></li>
            
                <li data-name="UnorderedBulkOperation#find"><a href="UnorderedBulkOperation.html#find">find</a></li>
            
                <li data-name="UnorderedBulkOperation#insert"><a href="UnorderedBulkOperation.html#insert">insert</a></li>
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="WriteConcernError">
            <span class="title">
                <a href="WriteConcernError.html">WriteConcernError</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="WriteError">
            <span class="title">
                <a href="WriteError.html">WriteError</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            </ul>
            <ul class="events itemMembers">
            
            </ul>
        </li>
    
    </ul>
</div>
            </td>
            <td valign='top'>        
                <div class="main">
                    <h1 class="page-title" data-filename="GridStore.html">Class: GridStore</h1>
                    



<section>
    
<header>
    <h2>
    GridStore
    </h2>
    
</header>  

<article>
    <div class="container-overview">
    
    
    
        
<dt>
    <div class="nameContainer">
        <h4 class="name" id="GridStore">
            
            new GridStore<span class="signature">(db, <span class="optional">id</span>, <span class="optional">filename</span>, mode, <span class="optional">options</span>)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{<a href="GridStore.html">GridStore</a>}</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line88">line 88</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>Create a new GridStore instance</p>
<p>Modes</p>
<ul>
<li><strong>&quot;r&quot;</strong> - read only. This is the default mode.</li>
<li><strong>&quot;w&quot;</strong> - write in truncate mode. Existing data will be overwritten.</li>
</ul>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		<th>Default</th>
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>db</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="Db.html">Db</a></span>


            
            </td>
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last">
                
                    
                    
                        
                    
                
                <p>A database instance to interact with.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>id</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">object</span>


            
            </td>
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>optional unique id for this file</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>filename</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>optional filename for this file, no unique constrain on the field</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>mode</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last">
                
                    
                    
                        
                    
                
                <p>set the mode for this file.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>options</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">object</span>


            
            </td>
            
            
                <td class="default">
                
                    null
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>Optional settings.</p>
                

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		<th>Default</th>
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>w</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">number</span>
|

<span class="param-type">string</span>


            
            </td>
            
            
                <td class="default">
                
                    null
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>The write concern.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>wtimeout</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>
            
            
                <td class="default">
                
                    null
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>The write concern timeout.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>j</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">boolean</span>


            
            </td>
            
            
                <td class="default">
                
                    false
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>Specify a journal write concern.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>fsync</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">boolean</span>


            
            </td>
            
            
                <td class="default">
                
                    false
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>Specify a file sync write concern.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>root</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>
            
            
                <td class="default">
                
                    null
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>Root collection to use. Defaults to <strong>{GridStore.DEFAULT_ROOT_COLLECTION}</strong>.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>content_type</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>
            
            
                <td class="default">
                
                    null
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>MIME type of the file. Defaults to <strong>{GridStore.DEFAULT_CONTENT_TYPE}</strong>.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>chunk_size</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>
            
            
                <td class="default">
                
                    261120
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>Size for the chunk. Defaults to <strong>{Chunk.DEFAULT_CHUNK_SIZE}</strong>.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>metadata</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">object</span>


            
            </td>
            
            
                <td class="default">
                
                    null
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>Arbitrary data the user wants to store.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>promiseLibrary</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">object</span>


            
            </td>
            
            
                <td class="default">
                
                    null
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>readPreference</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="ReadPreference.html">ReadPreference</a></span>
|

<span class="param-type">string</span>


            
            </td>
            
            
                <td class="default">
                
                    null
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).</p></td>
        </tr>
	
	
	</tbody>
</table>
            </td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
        <h5 class="subsection-title">Properties:</h5>
        
        <dl>

<table class="props">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>chunkSize</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>
            
            
            
            
            
            <td class="description last"><p>Get the gridstore chunk size.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>md5</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>
            
            
            
            
            
            <td class="description last"><p>The md5 checksum for this file.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>chunkNumber</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>
            
            
            
            
            
            <td class="description last"><p>The current chunk number the gridstore has materialized into memory</p></td>
        </tr>
	
	
	</tbody>
</table></dl>
        
    
        
    
    
    

    
        <dt class="important tag-deprecated">Deprecated</dt><dd><ul class="dummy"><li>Use GridFSBucket API instead</li><ul></dd>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    


<h5>Returns:</h5>
GridStore instance.
<br />

    
    
    
</dd>

    
    </div>
    
    
    
    
    
    
    
    
    
    
    
    
        <h3 class="subsection-title">Members</h3>
        
        <dl>
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id=".DEFAULT_CONTENT_TYPE"><span class="type-signature static">static</span>GridStore.DEFAULT_CONTENT_TYPE</h4>
    </div>
    
    
</dt>
<dd>
    
    <div class="description">
        <p>Default file mime type</p>
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id=".DEFAULT_ROOT_COLLECTION"><span class="type-signature static">static</span>GridStore.DEFAULT_ROOT_COLLECTION</h4>
    </div>
    
    
</dt>
<dd>
    
    <div class="description">
        <p>The collection to be used for holding the files and chunks collection.</p>
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id=".IO_SEEK_CUR"><span class="type-signature static">static</span>GridStore.IO_SEEK_CUR</h4>
    </div>
    
    
</dt>
<dd>
    
    <div class="description">
        <p>Seek mode where the given length is an offset to the current read/write head.</p>
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id=".IO_SEEK_END"><span class="type-signature static">static</span>GridStore.IO_SEEK_END</h4>
    </div>
    
    
</dt>
<dd>
    
    <div class="description">
        <p>Seek mode where the given length is an offset to the end of the file.</p>
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id=".IO_SEEK_SET"><span class="type-signature static">static</span>GridStore.IO_SEEK_SET</h4>
    </div>
    
    
</dt>
<dd>
    
    <div class="description">
        <p>Seek mode where the given length is absolute.</p>
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    
</dd>

        </dl>
    
    
    
        <h3 class="subsection-title">Methods</h3>
        
        <dl>
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id=".exist">
            
            <span class="type-signature static">static</span>GridStore.exist<span class="signature">(db, name, <span class="optional">rootCollection</span>, <span class="optional">options</span>, <span class="optional">callback</span>)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Promise}</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line1284">line 1284</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>Checks if a file exists in the database.</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		<th>Default</th>
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>db</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="Db.html">Db</a></span>


            
            </td>
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last">
                
                    
                    
                        
                    
                
                <p>the database to query.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>name</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last">
                
                    
                    
                        
                    
                
                <p>The name of the file to look for.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>rootCollection</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>The root collection that holds the files and chunks collection. Defaults to <strong>{GridStore.DEFAULT_ROOT_COLLECTION}</strong>.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>options</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">object</span>


            
            </td>
            
            
                <td class="default">
                
                    null
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>Optional settings.</p>
                

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		<th>Default</th>
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>readPreference</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="ReadPreference.html">ReadPreference</a></span>
|

<span class="param-type">string</span>


            
            </td>
            
            
                <td class="default">
                
                    null
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>promiseLibrary</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">object</span>


            
            </td>
            
            
                <td class="default">
                
                    null
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible</p></td>
        </tr>
	
	
	</tbody>
</table>
            </td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="GridStore.html#~resultCallback">GridStore~resultCallback</a></span>


            
            </td>
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>result from exists.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
        <dt class="important tag-deprecated">Deprecated</dt><dd><ul class="dummy"><li>Use GridFSBucket API instead</li><ul></dd>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    


<h5>Returns:</h5>
Promise if no callback passed
<br />

    
    
    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id=".list">
            
            <span class="type-signature static">static</span>GridStore.list<span class="signature">(db, <span class="optional">rootCollection</span>, <span class="optional">options</span>, <span class="optional">callback</span>)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Promise}</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line1356">line 1356</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>Gets the list of files stored in the GridFS.</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		<th>Default</th>
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>db</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="Db.html">Db</a></span>


            
            </td>
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last">
                
                    
                    
                        
                    
                
                <p>the database to query.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>rootCollection</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>The root collection that holds the files and chunks collection. Defaults to <strong>{GridStore.DEFAULT_ROOT_COLLECTION}</strong>.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>options</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">object</span>


            
            </td>
            
            
                <td class="default">
                
                    null
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>Optional settings.</p>
                

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		<th>Default</th>
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>readPreference</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="ReadPreference.html">ReadPreference</a></span>
|

<span class="param-type">string</span>


            
            </td>
            
            
                <td class="default">
                
                    null
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>promiseLibrary</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">object</span>


            
            </td>
            
            
                <td class="default">
                
                    null
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible</p></td>
        </tr>
	
	
	</tbody>
</table>
            </td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="GridStore.html#~resultCallback">GridStore~resultCallback</a></span>


            
            </td>
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>result from exists.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
        <dt class="important tag-deprecated">Deprecated</dt><dd><ul class="dummy"><li>Use GridFSBucket API instead</li><ul></dd>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    


<h5>Returns:</h5>
Promise if no callback passed
<br />

    
    
    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id=".read">
            
            <span class="type-signature static">static</span>GridStore.read<span class="signature">(db, name, <span class="optional">length</span>, <span class="optional">offset</span>, <span class="optional">options</span>, <span class="optional">callback</span>)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Promise}</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line1440">line 1440</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>Reads the contents of a file.</p>
<p>This method has the following signatures</p>
<p>(db, name, callback)<br>(db, name, length, callback)<br>(db, name, length, offset, callback)<br>(db, name, length, offset, options, callback)</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		<th>Default</th>
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>db</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="Db.html">Db</a></span>


            
            </td>
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last">
                
                    
                    
                        
                    
                
                <p>the database to query.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>name</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last">
                
                    
                    
                        
                    
                
                <p>The name of the file.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>length</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>The size of data to read.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>offset</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>The offset from the head of the file of which to start reading from.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>options</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">object</span>


            
            </td>
            
            
                <td class="default">
                
                    null
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>Optional settings.</p>
                

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		<th>Default</th>
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>readPreference</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="ReadPreference.html">ReadPreference</a></span>
|

<span class="param-type">string</span>


            
            </td>
            
            
                <td class="default">
                
                    null
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>promiseLibrary</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">object</span>


            
            </td>
            
            
                <td class="default">
                
                    null
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible</p></td>
        </tr>
	
	
	</tbody>
</table>
            </td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="GridStore.html#~readCallback">GridStore~readCallback</a></span>


            
            </td>
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>the command callback.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
        <dt class="important tag-deprecated">Deprecated</dt><dd><ul class="dummy"><li>Use GridFSBucket API instead</li><ul></dd>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    


<h5>Returns:</h5>
Promise if no callback passed
<br />

    
    
    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id=".readlines">
            
            <span class="type-signature static">static</span>GridStore.readlines<span class="signature">(db, name, <span class="optional">separator</span>, <span class="optional">options</span>, <span class="optional">callback</span>)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Promise}</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line1505">line 1505</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>Read the entire file as a list of strings splitting by the provided separator.</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		<th>Default</th>
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>db</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="Db.html">Db</a></span>


            
            </td>
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last">
                
                    
                    
                        
                    
                
                <p>the database to query.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>name</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>
|

<span class="param-type">object</span>


            
            </td>
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last">
                
                    
                    
                        
                    
                
                <p>the name of the file.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>separator</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>The character to be recognized as the newline separator.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>options</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">object</span>


            
            </td>
            
            
                <td class="default">
                
                    null
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>Optional settings.</p>
                

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		<th>Default</th>
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>readPreference</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="ReadPreference.html">ReadPreference</a></span>
|

<span class="param-type">string</span>


            
            </td>
            
            
                <td class="default">
                
                    null
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>promiseLibrary</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">object</span>


            
            </td>
            
            
                <td class="default">
                
                    null
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible</p></td>
        </tr>
	
	
	</tbody>
</table>
            </td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="GridStore.html#~readlinesCallback">GridStore~readlinesCallback</a></span>


            
            </td>
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>the command callback.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
        <dt class="important tag-deprecated">Deprecated</dt><dd><ul class="dummy"><li>Use GridFSBucket API instead</li><ul></dd>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    


<h5>Returns:</h5>
Promise if no callback passed
<br />

    
    
    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id=".unlink">
            
            <span class="type-signature static">static</span>GridStore.unlink<span class="signature">(db, names, <span class="optional">options</span>, <span class="optional">callback</span>)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Promise}</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line1556">line 1556</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>Deletes the chunks and metadata information of a file from GridFS.</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		<th>Default</th>
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>db</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="Db.html">Db</a></span>


            
            </td>
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last">
                
                    
                    
                        
                    
                
                <p>The database to query.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>names</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">array</span>


            
            </td>
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last">
                
                    
                    
                        
                    
                
                <p>The name/names of the files to delete.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>options</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">object</span>


            
            </td>
            
            
                <td class="default">
                
                    null
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>Optional settings.</p>
                

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		<th>Default</th>
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>promiseLibrary</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">object</span>


            
            </td>
            
            
                <td class="default">
                
                    null
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible</p></td>
        </tr>
	
	
	</tbody>
</table>
            </td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="GridStore.html#~resultCallback">GridStore~resultCallback</a></span>


            
            </td>
            
            
                <td class="default">
                
                </td>
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>the command callback.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
        <dt class="important tag-deprecated">Deprecated</dt><dd><ul class="dummy"><li>Use GridFSBucket API instead</li><ul></dd>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    


<h5>Returns:</h5>
Promise if no callback passed
<br />

    
    
    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id="chunkCollection">
            
            chunkCollection<span class="signature">(callback)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{<a href="Collection.html">Collection</a>}</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line578">line 578</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>Retrieve this file's chunks collection.</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="GridStore.html#~collectionCallback">GridStore~collectionCallback</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                <p>the command callback.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
        <dt class="important tag-deprecated">Deprecated</dt><dd><ul class="dummy"><li>Use GridFSBucket API instead</li><ul></dd>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    


    
    
    
        <h5>Example</h5>
        

    
    <pre class="prettyprint"><code>// A simple example showing how to access the chunks collection object.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Our file ID
  var fileId = new ObjectID();

  // Open a new file
  var gridStore = new GridStore(db, fileId, 'w');

  // Open the new file
  gridStore.open(function(err, gridStore) {

    // Access the Chunk collection
    gridStore.chunkCollection(function(err, collection) {
      test.equal(err, null);

      db.close();
    });
  });
});</code></pre>
    

    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id="close">
            
            close<span class="signature">(<span class="optional">callback</span>)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Promise}</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line483">line 483</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>Saves this file to the database. This will overwrite the old entry if it<br>already exists. This will work properly only if mode was initialized to<br>&quot;w&quot; or &quot;w+&quot;.</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="GridStore.html#~resultCallback">GridStore~resultCallback</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>this will be called after executing this method. The first parameter will contain null and the second one will contain a reference to this object.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
        <dt class="important tag-deprecated">Deprecated</dt><dd><ul class="dummy"><li>Use GridFSBucket API instead</li><ul></dd>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    


<h5>Returns:</h5>
Promise if no callback passed
<br />

    
    
    
        <h5>Examples</h5>
        

    
    <pre class="prettyprint"><code>// A simple example showing how to use the write command with strings and Buffers.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Our file ID
  var fileId = new ObjectID();

  // Open a new file
  var gridStore = new GridStore(db, fileId, 'w');

  // Open the new file
  gridStore.open(function(err, gridStore) {

    // Write a text string
    gridStore.write('Hello world', function(err, gridStore) {

      // Close the
      gridStore.close(function(err, result) {
        test.equal(err, null);

        db.close();
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing how to use the write command with strings and Buffers using a Promise.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Our file ID
  var fileId = new ObjectID();

  // Open a new file
  var gridStore = new GridStore(db, fileId, 'w');

  // Open the new file
  gridStore.open().then(function(gridStore) {

    // Write a text string
    gridStore.write('Hello world').then(function(gridStore) {

      // Close the
      gridStore.close().then(function(result) {

        db.close();
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing how to use the write command with strings and Buffers using a Generator and the co module.

var MongoClient = require('mongodb').MongoClient,
  co = require('co');
  test = require('assert');

co(function*() {
  var db = yield MongoClient.connect('mongodb://localhost:27017/test');
  // Our file ID
  var fileId = new ObjectID();

  // Open a new file
  var gridStore = new GridStore(db, fileId, 'w');

  // Open the new file
  yield gridStore.open();

  // Write a text string
  yield gridStore.write('Hello world');

  // Close the
  yield gridStore.close();

  db.close();
});</code></pre>
    

    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id="collection">
            
            collection<span class="signature">(callback)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{<a href="Collection.html">Collection</a>}</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line637">line 637</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>Retrieves the file collection associated with this object.</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="GridStore.html#~collectionCallback">GridStore~collectionCallback</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                <p>the command callback.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
        <dt class="important tag-deprecated">Deprecated</dt><dd><ul class="dummy"><li>Use GridFSBucket API instead</li><ul></dd>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    


    
    
    
        <h5>Example</h5>
        

    
    <pre class="prettyprint"><code>// A simple example showing how to access the files collection object.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Our file ID
  var fileId = new ObjectID();

  // Open a new file
  var gridStore = new GridStore(db, fileId, 'w');

  // Open the new file
  gridStore.open(function(err, gridStore) {

    // Access the Chunk collection
    gridStore.collection(function(err, collection) {
      test.equal(err, null);

      db.close();
    });
  });
});</code></pre>
    

    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id="destroy">
            
            destroy<span class="signature">()</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line375">line 375</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>Handles the destroy part of a stream</p>
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
        <dt class="important tag-deprecated">Deprecated</dt><dd><ul class="dummy"><li>Use GridFSBucket API instead</li><ul></dd>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id="eof">
            
            eof<span class="signature">()</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{boolean}</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line253">line 253</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>Verify if the file is at EOF.</p>
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
        <dt class="important tag-deprecated">Deprecated</dt><dd><ul class="dummy"><li>Use GridFSBucket API instead</li><ul></dd>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    


<h5>Returns:</h5>
if the read/write head is at the end of this file.
<br />

    
    
    
        <h5>Example</h5>
        

    
    <pre class="prettyprint"><code>// A simple example showing the usage of the eof method.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {

  // Open the file in write mode
  var gridStore = new GridStore(db, 'test_gs_empty_file_eof', "w");
  gridStore.open(function(err, gridStore) {
    // Flush the empty file to GridFS
    gridStore.close(function(err, gridStore) {

      // Open the file in read mode
      var gridStore2 = new GridStore(db, 'test_gs_empty_file_eof', "r");
      gridStore2.open(function(err, gridStore) {
        // Verify that we are at the end of the file
        test.equal(true, gridStore.eof());

        db.close();
      })
    });
  });
});</code></pre>
    

    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id="getc">
            
            getc<span class="signature">(<span class="optional">callback</span>)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Promise}</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line274">line 274</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>Retrieves a single character from this file.</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="GridStore.html#~resultCallback">GridStore~resultCallback</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>this gets called after this method is executed. Passes null to the first parameter and the character read to the second or null to the second if the read/write head is at the end of the file.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
        <dt class="important tag-deprecated">Deprecated</dt><dd><ul class="dummy"><li>Use GridFSBucket API instead</li><ul></dd>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    


<h5>Returns:</h5>
Promise if no callback passed
<br />

    
    
    
        <h5>Examples</h5>
        

    
    <pre class="prettyprint"><code>// A simple example showing the usage of the seek method.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Create a file and open it
  var gridStore = new GridStore(db, "test_gs_getc_file", "w");
  gridStore.open(function(err, gridStore) {
    // Write some content to the file
    gridStore.write(new Buffer("hello, world!", "utf8"), function(err, gridStore) {
      // Flush the file to GridFS
      gridStore.close(function(result) {

        // Open the file in read mode
        var gridStore2 = new GridStore(db, "test_gs_getc_file", "r");
        gridStore2.open(function(err, gridStore) {

          // Read first character and verify
          gridStore.getc(function(err, chr) {
            test.equal('h', chr);

            db.close();
          });
        });
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing the usage of the seek method using a Promise.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Create a file and open it
  var gridStore = new GridStore(db, "test_gs_getc_file", "w");
  gridStore.open().then(function(gridStore) {
    // Write some content to the file
    gridStore.write(new Buffer("hello, world!", "utf8")).then(function(gridStore) {
      // Flush the file to GridFS
      gridStore.close().then(function(result) {

        // Open the file in read mode
        var gridStore2 = new GridStore(db, "test_gs_getc_file", "r");
        gridStore2.open().then(function(gridStore) {

          // Read first character and verify
          gridStore.getc().then(function(chr) {
            test.equal('h', chr);

            db.close();
          });
        });
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing the usage of the seek method using a Generator and the co module.

var MongoClient = require('mongodb').MongoClient,
  co = require('co');
  test = require('assert');

co(function*() {
  var db = yield MongoClient.connect('mongodb://localhost:27017/test');
  // Create a file and open it
  var gridStore = new GridStore(db, "test_gs_getc_file", "w");
  yield gridStore.open();
  // Write some content to the file
  yield gridStore.write(new Buffer("hello, world!", "utf8"));
  // Flush the file to GridFS
  yield gridStore.close();
  // Open the file in read mode
  var gridStore = new GridStore(db, "test_gs_getc_file", "r");
  yield gridStore.open();

  // Read first character and verify
  var chr = yield gridStore.getc();
  test.equal('h', chr);

  db.close();
});</code></pre>
    

    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id="open">
            
            open<span class="signature">(<span class="optional">callback</span>)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Promise}</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line191">line 191</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>Opens the file from the database and initialize this object. Also creates a<br>new one if file does not exist.</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="GridStore.html#~openCallback">GridStore~openCallback</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>this will be called after executing this method</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
        <dt class="important tag-deprecated">Deprecated</dt><dd><ul class="dummy"><li>Use GridFSBucket API instead</li><ul></dd>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    


<h5>Returns:</h5>
Promise if no callback passed
<br />

    
    
    
        <h5>Examples</h5>
        

    
    <pre class="prettyprint"><code>// A simple example showing opening a file using a filename, writing to it and saving it.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Create a new instance of the gridstore
  var gridStore = new GridStore(db, 'ourexamplefiletowrite.txt', 'w');

  // Open the file
  gridStore.open(function(err, gridStore) {

    // Write some data to the file
    gridStore.write('bar', function(err, gridStore) {
      test.equal(null, err);

      // Close (Flushes the data to MongoDB)
      gridStore.close(function(err, result) {
        test.equal(null, err);

        // Verify that the file exists
        GridStore.exist(db, 'ourexamplefiletowrite.txt', function(err, result) {
          test.equal(null, err);
          test.equal(true, result);

          db.close();
        });
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing opening a file using an ObjectID, writing to it and saving it.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Our file ID
  var fileId = new ObjectID();

  // Create a new instance of the gridstore
  var gridStore = new GridStore(db, fileId, 'w');

  // Open the file
  gridStore.open(function(err, gridStore) {

    // Write some data to the file
    gridStore.write('bar', function(err, gridStore) {
      test.equal(null, err);

      // Close (Flushes the data to MongoDB)
      gridStore.close(function(err, result) {
        test.equal(null, err);

        // Verify that the file exists
        GridStore.exist(db, fileId, function(err, result) {
          test.equal(null, err);
          test.equal(true, result);

          db.close();
        });
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing how to save a file with a filename allowing for multiple files with the same name

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Create a file and open it
  var gridStore = new GridStore(db, new ObjectID(), "test_gs_getc_file", "w");
  gridStore.open(function(err, gridStore) {
    // Write some content to the file
    gridStore.write(new Buffer("hello, world!", "utf8"), function(err, gridStore) {
      // Flush the file to GridFS
      gridStore.close(function(err, fileData) {
        test.equal(null, err);

        // Create another file with same name and and save content to it
        gridStore = new GridStore(db, new ObjectID(), "test_gs_getc_file", "w");
        gridStore.open(function(err, gridStore) {
          // Write some content to the file
          gridStore.write(new Buffer("hello, world!", "utf8"), function(err, gridStore) {
            // Flush the file to GridFS
            gridStore.close(function(err, fileData) {
              test.equal(null, err);

              // Open the file in read mode using the filename
              var gridStore2 = new GridStore(db, "test_gs_getc_file", "r");
              gridStore2.open(function(err, gridStore) {

                // Read first character and verify
                gridStore.getc(function(err, chr) {
                  test.equal('h', chr);

                  // Open the file using an object id
                  gridStore2 = new GridStore(db, fileData._id, "r");
                  gridStore2.open(function(err, gridStore) {

                    // Read first character and verify
                    gridStore.getc(function(err, chr) {
                      test.equal('h', chr);

                      db.close();
                    })
                  });
                });
              });
            });
          });
        });
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing opening a file using a filename, writing to it and saving it using a Promise.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Create a new instance of the gridstore
  var gridStore = new GridStore(db, 'ourexamplefiletowrite.txt', 'w');

  // Open the file
  gridStore.open().then(function(gridStore) {

    // Write some data to the file
    gridStore.write('bar').then(function(gridStore) {

      // Close (Flushes the data to MongoDB)
      gridStore.close().then(function(result) {

        // Verify that the file exists
        GridStore.exist(db, 'ourexamplefiletowrite.txt').then(function(result) {
          test.equal(true, result);

          db.close();
        });
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing opening a file using an ObjectID, writing to it and saving it using a Promise.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Our file ID
  var fileId = new ObjectID();

  // Create a new instance of the gridstore
  var gridStore = new GridStore(db, fileId, 'w');

  // Open the file
  gridStore.open().then(function(gridStore) {

    // Write some data to the file
    gridStore.write('bar').then(function(gridStore) {

      // Close (Flushes the data to MongoDB)
      gridStore.close().then(function(result) {

        // Verify that the file exists
        GridStore.exist(db, fileId).then(function(result) {
          test.equal(true, result);

          db.close();
        });
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing how to save a file with a filename allowing for multiple files with the same name using a Promise.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Create a file and open it
  var gridStore = new GridStore(db, new ObjectID(), "test_gs_getc_file", "w");
  gridStore.open().then(function(gridStore) {
    // Write some content to the file
    gridStore.write(new Buffer("hello, world!", "utf8")).then(function(gridStore) {
      // Flush the file to GridFS
      gridStore.close().then(function(fileData) {

        // Create another file with same name and and save content to it
        gridStore = new GridStore(db, new ObjectID(), "test_gs_getc_file", "w");
        gridStore.open().then(function(gridStore) {
          // Write some content to the file
          gridStore.write(new Buffer("hello, world!", "utf8")).then(function(gridStore) {
            // Flush the file to GridFS
            gridStore.close().then(function(fileData) {

              // Open the file in read mode using the filename
              var gridStore2 = new GridStore(db, "test_gs_getc_file", "r");
              gridStore2.open().then(function(gridStore) {

                // Read first character and verify
                gridStore.getc().then(function(chr) {
                  test.equal('h', chr);

                  // Open the file using an object id
                  gridStore2 = new GridStore(db, fileData._id, "r");
                  gridStore2.open().then(function(gridStore) {

                    // Read first character and verify
                    gridStore.getc().then(function(chr) {
                      test.equal('h', chr);

                      db.close();
                    })
                  });
                });
              });
            });
          });
        });
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing opening a file using a filename, writing to it and saving it using a Generator and the co module.

var MongoClient = require('mongodb').MongoClient,
  co = require('co');
  test = require('assert');

co(function*() {
  var db = yield MongoClient.connect('mongodb://localhost:27017/test');
  // Create a new instance of the gridstore
  var gridStore = new GridStore(db, 'ourexamplefiletowrite.txt', 'w');

  // Open the file
  yield gridStore.open();

  // Write some data to the file
  yield gridStore.write('bar');

  // Close (Flushes the data to MongoDB)
  yield gridStore.close();

  // Verify that the file exists
  var result = yield GridStore.exist(db, 'ourexamplefiletowrite.txt');
  test.equal(true, result);

  db.close();
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing opening a file using an ObjectID, writing to it and saving it using a Generator and the co module.

var MongoClient = require('mongodb').MongoClient,
  co = require('co');
  test = require('assert');

co(function*() {
  var db = yield MongoClient.connect('mongodb://localhost:27017/test');
  // Our file ID
  var fileId = new ObjectID();

  // Create a new instance of the gridstore
  var gridStore = new GridStore(db, fileId, 'w');

  // Open the file
  yield gridStore.open();

  // Write some data to the file
  yield gridStore.write('bar');

  // Close (Flushes the data to MongoDB)
  yield gridStore.close();

  // Verify that the file exists
  var result = yield GridStore.exist(db, fileId);
  test.equal(true, result);

  db.close();
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing how to save a file with a filename allowing for multiple files with the same name using a Generator and the co module.

var MongoClient = require('mongodb').MongoClient,
  co = require('co');
  test = require('assert');

co(function*() {
  var db = yield MongoClient.connect('mongodb://localhost:27017/test');
  // Create a file and open it
  var gridStore = new GridStore(db, new ObjectID(), "test_gs_getc_file", "w");
  yield gridStore.open();
  // Write some content to the file
  yield gridStore.write(new Buffer("hello, world!", "utf8"));
  // Flush the file to GridFS
  yield gridStore.close();

  // Create another file with same name and and save content to it
  gridStore = new GridStore(db, new ObjectID(), "test_gs_getc_file", "w");
  yield gridStore.open();
  // Write some content to the file
  yield gridStore.write(new Buffer("hello, world!", "utf8"));
  // Flush the file to GridFS
  var fileData = yield gridStore.close();

  // Open the file in read mode using the filename
  var gridStore = new GridStore(db, "test_gs_getc_file", "r");
  yield gridStore.open();

  // Read first character and verify
  var chr = yield gridStore.getc();
  test.equal('h', chr);

  // Open the file using an object id
  gridStore = new GridStore(db, fileData._id, "r");
  yield gridStore.open();

  // Read first character and verify
  var chr = yield gridStore.getc();
  test.equal('h', chr);

  db.close();
});</code></pre>
    

    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id="puts">
            
            puts<span class="signature">(string, <span class="optional">callback</span>)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Promise}</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line314">line 314</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>Writes a string to the file with a newline character appended at the end if<br>the given string does not have one.</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>string</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>
            
            
            
            <td class="description last">
                
                    
                    
                        
                    
                
                <p>the string to write.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="GridStore.html#~resultCallback">GridStore~resultCallback</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>this will be called after executing this method. The first parameter will contain null and the second one will contain a reference to this object.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
        <dt class="important tag-deprecated">Deprecated</dt><dd><ul class="dummy"><li>Use GridFSBucket API instead</li><ul></dd>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    


<h5>Returns:</h5>
Promise if no callback passed
<br />

    
    
    
        <h5>Examples</h5>
        

    
    <pre class="prettyprint"><code>// A simple example showing the usage of the puts method.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Open a file for writing
  var gridStore = new GridStore(db, "test_gs_puts_and_readlines", "w");
  gridStore.open(function(err, gridStore) {

    // Write a line to the file using the puts method
    gridStore.puts("line one", function(err, gridStore) {

      // Flush the file to GridFS
      gridStore.close(function(err, result) {

        // Read in the entire contents
        GridStore.read(db, 'test_gs_puts_and_readlines', function(err, data) {
          test.equal("line one\n", data.toString());

          db.close();
        });
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing the usage of the puts method using a Promise.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Open a file for writing
  var gridStore = new GridStore(db, "test_gs_puts_and_readlines", "w");
  gridStore.open().then(function(gridStore) {

    // Write a line to the file using the puts method
    gridStore.puts("line one").then(function(gridStore) {

      // Flush the file to GridFS
      gridStore.close().then(function(result) {

        // Read in the entire contents
        GridStore.read(db, 'test_gs_puts_and_readlines').then(function(data) {
          test.equal("line one\n", data.toString());

          db.close();
        });
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing the usage of the puts method using a Generator and the co module.

var MongoClient = require('mongodb').MongoClient,
  co = require('co');
  test = require('assert');

co(function*() {
  var db = yield MongoClient.connect('mongodb://localhost:27017/test');
  // Open a file for writing
  var gridStore = new GridStore(db, "test_gs_puts_and_readlines", "w");
  yield gridStore.open();

  // Write a line to the file using the puts method
  yield gridStore.puts("line one");

  // Flush the file to GridFS
  yield gridStore.close();

  // Read in the entire contents
  var data = yield GridStore.read(db, 'test_gs_puts_and_readlines');
  test.equal("line one\n", data.toString());

  db.close();
});</code></pre>
    

    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id="read">
            
            read<span class="signature">(<span class="optional">length</span>, <span class="optional">buffer</span>, <span class="optional">callback</span>)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Promise}</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line769">line 769</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>Retrieves the contents of this file and advances the read/write head. Works with Buffers only.</p>
<p>There are 3 signatures for this method:</p>
<p>(callback)<br>(length, callback)<br>(length, buffer, callback)</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>length</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>
            
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>the number of characters to read. Reads all the characters from the read/write head to the EOF if not specified.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>buffer</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">Buffer</span>


            
            </td>
            
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>a string to hold temporary data. This is used for storing the string data read so far when recursively calling this method.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="GridStore.html#~readCallback">GridStore~readCallback</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>the command callback.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
        <dt class="important tag-deprecated">Deprecated</dt><dd><ul class="dummy"><li>Use GridFSBucket API instead</li><ul></dd>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    


<h5>Returns:</h5>
Promise if no callback passed
<br />

    
    
    
        <h5>Examples</h5>
        

    
    <pre class="prettyprint"><code>// A simple example showing the usage of the read method.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Read in the content of a file
  var data = fs.readFileSync('./test/functional/data/iya_logo_final_bw.jpg');
  // Create a new file
  var gs = new GridStore(db, "test", "w");
  // Open the file
  gs.open(function(err, gs) {
    // Write the file to GridFS
    gs.write(data, function(err, gs) {
      // Flush to the GridFS
      gs.close(function(err, gs) {

        // Define the file we wish to read
        var gs2 = new GridStore(db, "test", "r");
        // Open the file
        gs2.open(function(err, gs) {
          // Set the pointer of the read head to the start of the gridstored file
          gs2.seek(0, function() {
            // Read the entire file
            gs2.read(function(err, data2) {
              // Compare the file content against the orgiinal
              test.equal(data.toString('base64'), data2.toString('base64'));

              db.close();
            });
          });
        });
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing the usage of the read method using a Promise.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Read in the content of a file
  var data = fs.readFileSync('./test/functional/data/iya_logo_final_bw.jpg');
  // Create a new file
  var gs = new GridStore(db, "test", "w");
  // Open the file
  gs.open().then(function(gs) {
    // Write the file to GridFS
    gs.write(data).then(function(gs) {
      // Flush to the GridFS
      gs.close().then(function(gs) {

        // Define the file we wish to read
        var gs2 = new GridStore(db, "test", "r");
        // Open the file
        gs2.open().then(function(gs) {
          // Set the pointer of the read head to the start of the gridstored file
          gs2.seek(0).then(function() {
            // Read the entire file
            gs2.read().then(function(data2) {
              // Compare the file content against the orgiinal
              test.equal(data.toString('base64'), data2.toString('base64'));

              db.close();
            });
          });
        });
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing the usage of the read method using a Generator and the co module.

var MongoClient = require('mongodb').MongoClient,
  co = require('co');
  test = require('assert');

co(function*() {
  var db = yield MongoClient.connect('mongodb://localhost:27017/test');
  // Read in the content of a file
  var data = fs.readFileSync('./test/functional/data/iya_logo_final_bw.jpg');
  // Create a new file
  var gs = new GridStore(db, "test", "w");
  // Open the file
  yield gs.open();
  // Write the file to GridFS
  yield gs.write(data);
  // Flush to the GridFS
  yield gs.close();

  // Define the file we wish to read
  var gs2 = new GridStore(db, "test", "r");
  // Open the file
  yield gs2.open();
  // Set the pointer of the read head to the start of the gridstored file
  yield gs2.seek(0);
  // Read the entire file
  var data2 = yield gs2.read();
  // Compare the file content against the orgiinal
  test.equal(data.toString('base64'), data2.toString('base64'));

  db.close();
});</code></pre>
    

    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id="readlines">
            
            readlines<span class="signature">(<span class="optional">separator</span>, <span class="optional">callback</span>)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Promise}</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line661">line 661</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>Read the entire file as a list of strings splitting by the provided separator.</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>separator</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>
            
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>The character to be recognized as the newline separator.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="GridStore.html#~readlinesCallback">GridStore~readlinesCallback</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>the command callback.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
        <dt class="important tag-deprecated">Deprecated</dt><dd><ul class="dummy"><li>Use GridFSBucket API instead</li><ul></dd>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    


<h5>Returns:</h5>
Promise if no callback passed
<br />

    
    
    
        <h5>Examples</h5>
        

    
    <pre class="prettyprint"><code>// A simple example showing reading back using readlines to split the text into lines by the seperator provided.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Our file ID
  var fileId = new ObjectID();

  // Open a new file
  var gridStore = new GridStore(db, fileId, 'w');

  // Open the new file
  gridStore.open(function(err, gridStore) {

    // Write one line to gridStore
    gridStore.puts("line one", function(err, gridStore) {

      // Write second line to gridStore
      gridStore.puts("line two", function(err, gridStore) {

        // Write third line to gridStore
        gridStore.puts("line three", function(err, gridStore) {

          // Flush file to disk
          gridStore.close(function(err, result) {

            // Open file for reading
            gridStore = new GridStore(db, fileId, 'r');
            gridStore.open(function(err, gridStore) {

              // Read all the lines and verify correctness
              gridStore.readlines(function(err, lines) {
                test.deepEqual(["line one\n", "line two\n", "line three\n"], lines);

                db.close();
              });
            });
          });
        });
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing reading back using readlines to split the text into lines by the separator provided using a Promise.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Our file ID
  var fileId = new ObjectID();

  // Open a new file
  var gridStore = new GridStore(db, fileId, 'w');

  // Open the new file
  gridStore.open().then(function(gridStore) {

    // Write one line to gridStore
    gridStore.puts("line one").then(function(gridStore) {

      // Write second line to gridStore
      gridStore.puts("line two").then(function(gridStore) {

        // Write third line to gridStore
        gridStore.puts("line three").then(function(gridStore) {

          // Flush file to disk
          gridStore.close().then(function(result) {

            // Open file for reading
            gridStore = new GridStore(db, fileId, 'r');
            gridStore.open().then(function(gridStore) {

              // Read all the lines and verify correctness
              gridStore.readlines().then(function(lines) {
                test.deepEqual(["line one\n", "line two\n", "line three\n"], lines);

                db.close();
              });
            });
          });
        });
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing reading back using readlines to split the text into lines by the separator provided using a Generator and the co module.

var MongoClient = require('mongodb').MongoClient,
  co = require('co');
  test = require('assert');

co(function*() {
  var db = yield MongoClient.connect('mongodb://localhost:27017/test');
  // Our file ID
  var fileId = new ObjectID();

  // Open a new file
  var gridStore = new GridStore(db, fileId, 'w');

  // Open the new file
  yield gridStore.open();

  // Write one line to gridStore
  yield gridStore.puts("line one");

  // Write second line to gridStore
  yield gridStore.puts("line two");

  // Write third line to gridStore
  yield gridStore.puts("line three");

  // Flush file to disk
  yield gridStore.close();

  // Open file for reading
  gridStore = new GridStore(db, fileId, 'r');
  yield gridStore.open();

  // Read all the lines and verify correctness
  var lines = yield gridStore.readlines();
  test.deepEqual(["line one\n", "line two\n", "line three\n"], lines);

  db.close();
});</code></pre>
    

    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id="rewind">
            
            rewind<span class="signature">(<span class="optional">callback</span>)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Promise}</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line706">line 706</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>Deletes all the chunks of this file in the database if mode was set to &quot;w&quot; or<br>&quot;w+&quot; and resets the read/write head to the initial position.</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="GridStore.html#~resultCallback">GridStore~resultCallback</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>this will be called after executing this method. The first parameter will contain null and the second one will contain a reference to this object.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
        <dt class="important tag-deprecated">Deprecated</dt><dd><ul class="dummy"><li>Use GridFSBucket API instead</li><ul></dd>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    


<h5>Returns:</h5>
Promise if no callback passed
<br />

    
    
    
        <h5>Examples</h5>
        

    
    <pre class="prettyprint"><code>// A simple example showing how to rewind and overwrite the file.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Our file ID
  var fileId = new ObjectID();

  // Create a new file
  var gridStore = new GridStore(db, fileId, "w");
  // Open the file
  gridStore.open(function(err, gridStore) {
    // Write to the file
    gridStore.write("hello, world!", function(err, gridStore) {
      // Flush the file to disk
      gridStore.close(function(err, result) {

        // Reopen the file
        gridStore = new GridStore(db, fileId, "w");
        gridStore.open(function(err, gridStore) {
          // Write some more text to the file
          gridStore.write('some text is inserted here', function(err, gridStore) {

            // Let's rewind to truncate the file
            gridStore.rewind(function(err, gridStore) {

              // Write something from the start
              gridStore.write('abc', function(err, gridStore) {

                // Flush the data to mongodb
                gridStore.close(function(err, result) {

                  // Verify that the new data was written
                  GridStore.read(db, fileId, function(err, data) {
                    test.equal("abc", data);

                    db.close();
                  });
                });
              });
            });
          });
        });
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing how to rewind and overwrite the file using a Promise.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Our file ID
  var fileId = new ObjectID();

  // Create a new file
  var gridStore = new GridStore(db, fileId, "w");
  // Open the file
  gridStore.open().then(function(gridStore) {
    // Write to the file
    gridStore.write("hello, world!").then(function(gridStore) {
      // Flush the file to disk
      gridStore.close().then(function(result) {

        // Reopen the file
        gridStore = new GridStore(db, fileId, "w");
        gridStore.open().then(function(gridStore) {
          // Write some more text to the file
          gridStore.write('some text is inserted here').then(function(gridStore) {

            // Let's rewind to truncate the file
            gridStore.rewind().then(function(gridStore) {

              // Write something from the start
              gridStore.write('abc').then(function(gridStore) {

                // Flush the data to mongodb
                gridStore.close().then(function(result) {

                  // Verify that the new data was written
                  GridStore.read(db, fileId).then(function(data) {
                    test.equal("abc", data);

                    db.close();
                  });
                });
              });
            });
          });
        });
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing how to rewind and overwrite the file using a Generator and the co module.

var MongoClient = require('mongodb').MongoClient,
  co = require('co');
  test = require('assert');

co(function*() {
  var db = yield MongoClient.connect('mongodb://localhost:27017/test');
  // Our file ID
  var fileId = new ObjectID();

  // Create a new file
  var gridStore = new GridStore(db, fileId, "w");
  // Open the file
  yield gridStore.open();
  // Write to the file
  yield gridStore.write("hello, world!");
  // Flush the file to disk
  yield gridStore.close();

  // Reopen the file
  gridStore = new GridStore(db, fileId, "w");
  yield gridStore.open();
  // Write some more text to the file
  yield gridStore.write('some text is inserted here');

  // Let's rewind to truncate the file
  yield gridStore.rewind();

  // Write something from the start
  yield gridStore.write('abc');

  // Flush the data to mongodb
  yield gridStore.close();

  // Verify that the new data was written
  var data = yield GridStore.read(db, fileId);
  test.equal("abc", data);

  db.close();
});</code></pre>
    

    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id="seek">
            
            seek<span class="signature">(<span class="optional">position</span>, <span class="optional">seekLocation</span>, <span class="optional">callback</span>)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Promise}</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line886">line 886</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>Moves the read/write head to a new location.</p>
<p>There are 3 signatures for this method</p>
<p>Seek Location Modes</p>
<ul>
<li><strong>GridStore.IO_SEEK_SET</strong>, <strong>(default)</strong> set the position from the start of the file.</li>
<li><strong>GridStore.IO_SEEK_CUR</strong>, set the position from the current position in the file.</li>
<li><strong>GridStore.IO_SEEK_END</strong>, set the position from the end of the file.</li>
</ul>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>position</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>
            
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>the position to seek to</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>seekLocation</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>
            
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>seek mode. Use one of the Seek Location modes.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="GridStore.html#~gridStoreCallback">GridStore~gridStoreCallback</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>the command callback.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
        <dt class="important tag-deprecated">Deprecated</dt><dd><ul class="dummy"><li>Use GridFSBucket API instead</li><ul></dd>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    


<h5>Returns:</h5>
Promise if no callback passed
<br />

    
    
    
        <h5>Example</h5>
        

    
    <pre class="prettyprint"><code>// A simple example showing the usage of the seek method.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Create a file and open it
  var gridStore = new GridStore(db, "test_gs_seek_with_buffer", "w");
  gridStore.open(function(err, gridStore) {
    // Write some content to the file
    gridStore.write(new Buffer("hello, world!", "utf8"), function(err, gridStore) {
      // Flush the file to GridFS
      gridStore.close(function(result) {

        // Open the file in read mode
        var gridStore2 = new GridStore(db, "test_gs_seek_with_buffer", "r");
        gridStore2.open(function(err, gridStore) {
          // Seek to start
          gridStore.seek(0, function(err, gridStore) {
            // Read first character and verify
            gridStore.getc(function(err, chr) {
              test.equal('h', chr);
            });
          });
        });

        // Open the file in read mode
        var gridStore3 = new GridStore(db, "test_gs_seek_with_buffer", "r");
        gridStore3.open(function(err, gridStore) {
          // Seek to 7 characters from the beginning off the file and verify
          gridStore.seek(7, function(err, gridStore) {
            gridStore.getc(function(err, chr) {
              test.equal('w', chr);
            });
          });
        });

        // Open the file in read mode
        var gridStore5 = new GridStore(db, "test_gs_seek_with_buffer", "r");
        gridStore5.open(function(err, gridStore) {
          // Seek to -1 characters from the end off the file and verify
          gridStore.seek(-1, GridStore.IO_SEEK_END, function(err, gridStore) {
            gridStore.getc(function(err, chr) {
              test.equal('!', chr);
            });
          });
        });

        // Open the file in read mode
        var gridStore6 = new GridStore(db, "test_gs_seek_with_buffer", "r");
        gridStore6.open(function(err, gridStore) {
          // Seek to -6 characters from the end off the file and verify
          gridStore.seek(-6, GridStore.IO_SEEK_END, function(err, gridStore) {
            gridStore.getc(function(err, chr) {
              test.equal('w', chr);
            });
          });
        });

        // Open the file in read mode
        var gridStore7 = new GridStore(db, "test_gs_seek_with_buffer", "r");
        gridStore7.open(function(err, gridStore) {

          // Seek forward 7 characters from the current read position and verify
          gridStore.seek(7, GridStore.IO_SEEK_CUR, function(err, gridStore) {
            gridStore.getc(function(err, chr) {
              test.equal('w', chr);

              // Seek forward -1 characters from the current read position and verify
              gridStore.seek(-1, GridStore.IO_SEEK_CUR, function(err, gridStore) {
                gridStore.getc(function(err, chr) {
                  test.equal('w', chr);

                  // Seek forward -4 characters from the current read position and verify
                  gridStore.seek(-4, GridStore.IO_SEEK_CUR, function(err, gridStore) {
                    gridStore.getc(function(err, chr) {
                      test.equal('o', chr);

                      // Seek forward 3 characters from the current read position and verify
                      gridStore.seek(3, GridStore.IO_SEEK_CUR, function(err, gridStore) {
                        gridStore.getc(function(err, chr) {
                          test.equal('o', chr);

                          db.close();
                        });
                      });
                    });
                  });
                });
              });
            });
          });
        });
      });
    });
  });
});</code></pre>
    

    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id="stream">
            
            stream<span class="signature">()</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{<a href="GridStoreStream.html">GridStoreStream</a>}</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line337">line 337</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>Return a modified Readable stream including a possible transform method.</p>
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
        <dt class="important tag-deprecated">Deprecated</dt><dd><ul class="dummy"><li>Use GridFSBucket API instead</li><ul></dd>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    


    
    
    
        <h5>Examples</h5>
        

    
    <pre class="prettyprint"><code>// A simple example showing the usage of the stream method.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Open a file for reading
  var gridStoreR = new GridStore(db, "test_gs_read_stream", "r");
  // Open a file for writing
  var gridStoreW = new GridStore(db, "test_gs_read_stream", "w");
  // Read in the data of a file
  var data = fs.readFileSync("./test/functional/data/test_gs_weird_bug.png");

  var readLen = 0;
  var gotEnd = 0;

  // Open the file we are writting to
  gridStoreW.open(function(err, gs) {
    // Write the file content
    gs.write(data, function(err, gs) {
      // Flush the file to GridFS
      gs.close(function(err, result) {

        // Open the read file
        gridStoreR.open(function(err, gs) {
          // Create a stream to the file
          var stream = gs.stream();

          // Register events
          stream.on("data", function(chunk) {
            // Record the length of the file
            readLen += chunk.length;
          });

          stream.on("end", function() {
            // Verify the correctness of the read data
            test.equal(data.length, readLen);
            db.close();
          });
        });
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing how to pipe a to a gridstore object

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Set up gridStore
  var gridStore = new GridStore(client, "test_stream_write", "w");
  var stream = gridStore.stream();
  // Create a file reader stream to an object
  var fileStream = fs.createReadStream("./test/functional/data/test_gs_working_field_read.pdf");
  stream.on("end", function(err) {
    // Just read the content and compare to the raw binary
    GridStore.read(client, "test_stream_write", function(err, gridData) {
      var fileData = fs.readFileSync("./test/functional/data/test_gs_working_field_read.pdf");
      test.equal(fileData.toString('hex'), gridData.toString('hex'));
      client.close();
    })
  });

  // Pipe it through to the gridStore
  fileStream.pipe(stream);
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing how to pipe a file stream through from gridfs to a file

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Open a file for writing
  var gridStoreWrite = new GridStore(db, "test_gs_read_stream_pipe", "w", {chunkSize:1024});
  gridStoreWrite.writeFile("./test/functional/data/test_gs_weird_bug.png", function(err, result) {
    test.equal(null, err);
    test.ok(result != null);
    // Open the gridStore for reading and pipe to a file
    var gridStore = new GridStore(db, "test_gs_read_stream_pipe", "r");
    gridStore.open(function(err, gridStore) {
      // Create a file write stream
      var fileStream = fs.createWriteStream("./test_gs_weird_bug_streamed.tmp");
      // Grab the read stream
      var stream = gridStore.stream();
      // When the stream is finished close the database
      fileStream.on("close", function(err) {
        // Read the original content
        var originalData = fs.readFileSync("./test/functional/data/test_gs_weird_bug.png");
        // Ensure we are doing writing before attempting to open the file
        fs.readFile("./test_gs_weird_bug_streamed.tmp", function(err, streamedData) {
          // Compare the data
          for(var i = 0; i < originalData.length; i++) {
            test.equal(originalData[i], streamedData[i])
          }

          // Close the database
          db.close();
        });
      });

      // Pipe out the data
      stream.pipe(fileStream);
    })
  })
});</code></pre>
    

    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id="tell">
            
            tell<span class="signature">(<span class="optional">length</span>, <span class="optional">buffer</span>, <span class="optional">callback</span>)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Promise}</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line850">line 850</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>Retrieves the position of the read/write head of this file.</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>length</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>
            
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>the number of characters to read. Reads all the characters from the read/write head to the EOF if not specified.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>buffer</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">Buffer</span>


            
            </td>
            
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>a string to hold temporary data. This is used for storing the string data read so far when recursively calling this method.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="GridStore.html#~tellCallback">GridStore~tellCallback</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>the command callback.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
        <dt class="important tag-deprecated">Deprecated</dt><dd><ul class="dummy"><li>Use GridFSBucket API instead</li><ul></dd>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    


<h5>Returns:</h5>
Promise if no callback passed
<br />

    
    
    
        <h5>Examples</h5>
        

    
    <pre class="prettyprint"><code>// A simple example showing the usage of the tell method.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Create a new file
  var gridStore = new GridStore(db, "test_gs_tell", "w");
  // Open the file
  gridStore.open(function(err, gridStore) {
    // Write a string to the file
    gridStore.write("hello, world!", function(err, gridStore) {
      // Flush the file to GridFS
      gridStore.close(function(err, result) {

        // Open the file in read only mode
        var gridStore2 = new GridStore(db, "test_gs_tell", "r");
        gridStore2.open(function(err, gridStore) {

          // Read the first 5 characters
          gridStore.read(5, function(err, data) {
            test.equal("hello", data);

            // Get the current position of the read head
            gridStore.tell(function(err, position) {
              test.equal(5, position);

              db.close();
            });
          });
        });
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing the usage of the tell method using a Promise.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Create a new file
  var gridStore = new GridStore(db, "test_gs_tell", "w");
  // Open the file
  gridStore.open().then(function(gridStore) {
    // Write a string to the file
    gridStore.write("hello, world!").then(function(gridStore) {
      // Flush the file to GridFS
      gridStore.close().then(function(result) {

        // Open the file in read only mode
        var gridStore2 = new GridStore(db, "test_gs_tell", "r");
        gridStore2.open().then(function(gridStore) {

          // Read the first 5 characters
          gridStore.read(5).then(function(data) {
            test.equal("hello", data);

            // Get the current position of the read head
            gridStore.tell().then(function(position) {
              test.equal(5, position);

              db.close();
            });
          });
        });
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing the usage of the tell method using a Generator and the co module.

var MongoClient = require('mongodb').MongoClient,
  co = require('co');
  test = require('assert');

co(function*() {
  var db = yield MongoClient.connect('mongodb://localhost:27017/test');
  // Create a new file
  var gridStore = new GridStore(db, "test_gs_tell", "w");
  // Open the file
  yield gridStore.open();
  // Write a string to the file
  yield gridStore.write("hello, world!");
  // Flush the file to GridFS
  yield gridStore.close();

  // Open the file in read only mode
  var gridStore = new GridStore(db, "test_gs_tell", "r");
  yield gridStore.open();

  // Read the first 5 characters
  var data = yield gridStore.read(5);
  test.equal("hello", data);

  // Get the current position of the read head
  var position = yield gridStore.tell();
  test.equal(5, position);

  db.close();
});</code></pre>
    

    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id="unlink">
            
            unlink<span class="signature">(<span class="optional">callback</span>)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Promise}</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line594">line 594</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>Deletes all the chunks of this file in the database.</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="GridStore.html#~resultCallback">GridStore~resultCallback</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>the command callback.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
        <dt class="important tag-deprecated">Deprecated</dt><dd><ul class="dummy"><li>Use GridFSBucket API instead</li><ul></dd>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    


<h5>Returns:</h5>
Promise if no callback passed
<br />

    
    
    
        <h5>Examples</h5>
        

    
    <pre class="prettyprint"><code>// A simple example showing how to use the instance level unlink command to delete a gridstore item.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Our file ID
  var fileId = new ObjectID();

  // Open a new file
  var gridStore = new GridStore(db, fileId, 'w');

  // Open the new file
  gridStore.open(function(err, gridStore) {

    // Write a text string
    gridStore.write('Hello world', function(err, gridStore) {

      // Close the
      gridStore.close(function(err, result) {
        test.equal(err, null);

        // Open the file again and unlin it
        new GridStore(db, fileId, 'r').open(function(err, gridStore) {

          // Unlink the file
          gridStore.unlink(function(err, result) {
            test.equal(null, err);

            // Verify that the file no longer exists
            GridStore.exist(db, fileId, function(err, result) {
              test.equal(null, err);
              test.equal(false, result);

              db.close();
            });
          });
        });
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing how to use the instance level unlink command to delete a gridstore item using a Promise.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Our file ID
  var fileId = new ObjectID();

  // Open a new file
  var gridStore = new GridStore(db, fileId, 'w');

  // Open the new file
  gridStore.open().then(function(gridStore) {

    // Write a text string
    gridStore.write('Hello world').then(function(gridStore) {

      // Close the
      gridStore.close().then(function(result) {

        // Open the file again and unlin it
        new GridStore(db, fileId, 'r').open().then(function(gridStore) {

          // Unlink the file
          gridStore.unlink().then(function(result) {

            // Verify that the file no longer exists
            GridStore.exist(db, fileId).then(function(result) {
              test.equal(false, result);

              db.close();
            });
          });
        });
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing how to use the instance level unlink command to delete a gridstore item using a Generator and the co module.

var MongoClient = require('mongodb').MongoClient,
  co = require('co');
  test = require('assert');

co(function*() {
  var db = yield MongoClient.connect('mongodb://localhost:27017/test');
  // Our file ID
  var fileId = new ObjectID();

  // Open a new file
  var gridStore = new GridStore(db, fileId, 'w');

  // Open the new file
  yield gridStore.open();

  // Write a text string
  yield gridStore.write('Hello world');

  // Close the
  yield gridStore.close();

  // Open the file again and unlin it
  gridStore = yield new GridStore(db, fileId, 'r').open();

  // Unlink the file
  yield gridStore.unlink();

  // Verify that the file no longer exists
  var result = yield GridStore.exist(db, fileId);
  test.equal(false, result);

  db.close();
});</code></pre>
    

    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id="write">
            
            write<span class="signature">(data, <span class="optional">close</span>, <span class="optional">callback</span>)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Promise}</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line353">line 353</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>Writes some data. This method will work properly only if initialized with mode &quot;w&quot; or &quot;w+&quot;.</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>data</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">Buffer</span>


            
            </td>
            
            
            
            <td class="description last">
                
                    
                    
                        
                    
                
                <p>the data to write.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>close</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">boolean</span>


            
            </td>
            
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>closes this file after writing if set to true.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="GridStore.html#~resultCallback">GridStore~resultCallback</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>this will be called after executing this method. The first parameter will contain null and the second one will contain a reference to this object.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
        <dt class="important tag-deprecated">Deprecated</dt><dd><ul class="dummy"><li>Use GridFSBucket API instead</li><ul></dd>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    


<h5>Returns:</h5>
Promise if no callback passed
<br />

    
    
    
        <h5>Examples</h5>
        

    
    <pre class="prettyprint"><code>// A simple example showing how to use the write command with strings and Buffers.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Our file ID
  var fileId = new ObjectID();

  // Open a new file
  var gridStore = new GridStore(db, fileId, 'w');

  // Open the new file
  gridStore.open(function(err, gridStore) {

    // Write a text string
    gridStore.write('Hello world', function(err, gridStore) {

      // Write a buffer
      gridStore.write(new Buffer('Buffer Hello world'), function(err, gridStore) {

        // Close the
        gridStore.close(function(err, result) {

          // Read back all the written content and verify the correctness
          GridStore.read(db, fileId, function(err, fileData) {
            test.equal('Hello worldBuffer Hello world', fileData.toString());

            db.close();
          });
        });
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing how to use the write command with strings and Buffers using a Promise.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Our file ID
  var fileId = new ObjectID();

  // Open a new file
  var gridStore = new GridStore(db, fileId, 'w');

  // Open the new file
  gridStore.open().then(function(gridStore) {

    // Write a text string
    gridStore.write('Hello world').then(function(gridStore) {

      // Write a buffer
      gridStore.write(new Buffer('Buffer Hello world')).then(function(gridStore) {

        // Close the
        gridStore.close().then(function(result) {

          // Read back all the written content and verify the correctness
          GridStore.read(db, fileId).then(function(fileData) {
            test.equal('Hello worldBuffer Hello world', fileData.toString());

            db.close();
          });
        });
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing how to use the write command with strings and Buffers using a Generator and the co module.

var MongoClient = require('mongodb').MongoClient,
  co = require('co');
  test = require('assert');

co(function*() {
  var db = yield MongoClient.connect('mongodb://localhost:27017/test');
  // Our file ID
  var fileId = new ObjectID();

  // Open a new file
  var gridStore = new GridStore(db, fileId, 'w');

  // Open the new file
  yield gridStore.open();

  // Write a text string
  yield gridStore.write('Hello world');

  // Write a buffer
  yield gridStore.write(new Buffer('Buffer Hello world'));

  // Close the
  yield gridStore.close();

  // Read back all the written content and verify the correctness
  var fileData = yield GridStore.read(db, fileId);
  test.equal('Hello worldBuffer Hello world', fileData.toString());

  db.close();
});</code></pre>
    

    
</dd>

        
            
<dt>
    <div class="nameContainer">
        <h4 class="name" id="writeFile">
            
            writeFile<span class="signature">(file, <span class="optional">callback</span>)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Promise}</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line397">line 397</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>Stores a file from the file system to the GridFS database.</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>file</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">Buffer</span>
|

<span class="param-type">FileHandle</span>


            
            </td>
            
            
            
            <td class="description last">
                
                    
                    
                        
                    
                
                <p>the file to store.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="GridStore.html#~resultCallback">GridStore~resultCallback</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                    
                        <span class="optional">optional</span>
                    
                    
                        
                    
                
                <p>this will be called after executing this method. The first parameter will contain null and the second one will contain a reference to this object.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
        <dt class="important tag-deprecated">Deprecated</dt><dd><ul class="dummy"><li>Use GridFSBucket API instead</li><ul></dd>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    


<h5>Returns:</h5>
Promise if no callback passed
<br />

    
    
    
        <h5>Examples</h5>
        

    
    <pre class="prettyprint"><code>// A simple example showing how to write a file to Gridstore using file location path.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Our file ID
  var fileId = new ObjectID();

  // Open a new file
  var gridStore = new GridStore(db, fileId, 'w');

  // Read the filesize of file on disk (provide your own)
  var fileSize = fs.statSync('./test/functional/data/test_gs_weird_bug.png').size;
  // Read the buffered data for comparision reasons
  var data = fs.readFileSync('./test/functional/data/test_gs_weird_bug.png');

  // Open the new file
  gridStore.open(function(err, gridStore) {

    // Write the file to gridFS
    gridStore.writeFile('./test/functional/data/test_gs_weird_bug.png', function(err, doc) {

      // Read back all the written content and verify the correctness
      GridStore.read(db, fileId, function(err, fileData) {
        test.equal(data.toString('base64'), fileData.toString('base64'))
        test.equal(fileSize, fileData.length);

        db.close();
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing how to write a file to Gridstore using a file handle.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Our file ID
  var fileId = new ObjectID();

  // Open a new file
  var gridStore = new GridStore(db, fileId, 'w');

  // Read the filesize of file on disk (provide your own)
  var fileSize = fs.statSync('./test/functional/data/test_gs_weird_bug.png').size;
  // Read the buffered data for comparision reasons
  var data = fs.readFileSync('./test/functional/data/test_gs_weird_bug.png');

  // Open a file handle for reading the file
  var fd = fs.openSync('./test/functional/data/test_gs_weird_bug.png', 'r', parseInt('0666',8));

  // Open the new file
  gridStore.open(function(err, gridStore) {

    // Write the file to gridFS using the file handle
    gridStore.writeFile(fd, function(err, doc) {

      // Read back all the written content and verify the correctness
      GridStore.read(db, fileId, function(err, fileData) {
        test.equal(data.toString('base64'), fileData.toString('base64'));
        test.equal(fileSize, fileData.length);

        db.close();
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing how to write a file to Gridstore using file location path using a Promise.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Our file ID
  var fileId = new ObjectID();

  // Open a new file
  var gridStore = new GridStore(db, fileId, 'w');

  // Read the filesize of file on disk (provide your own)
  var fileSize = fs.statSync('./test/functional/data/test_gs_weird_bug.png').size;
  // Read the buffered data for comparision reasons
  var data = fs.readFileSync('./test/functional/data/test_gs_weird_bug.png');

  // Open the new file
  gridStore.open().then(function(gridStore) {

    // Write the file to gridFS
    gridStore.writeFile('./test/functional/data/test_gs_weird_bug.png').then(function(doc) {

      // Read back all the written content and verify the correctness
      GridStore.read(db, fileId).then(function(fileData) {
        test.equal(data.toString('base64'), fileData.toString('base64'))
        test.equal(fileSize, fileData.length);

        db.close();
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing how to write a file to Gridstore using a file handle using a Promise.

var MongoClient = require('mongodb').MongoClient,
  GridStore = require('mongodb').GridStore,
  ObjectID = require('mongodb').ObjectID,
  test = require('assert');
MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
  // Our file ID
  var fileId = new ObjectID();

  // Open a new file
  var gridStore = new GridStore(db, fileId, 'w');

  // Read the filesize of file on disk (provide your own)
  var fileSize = fs.statSync('./test/functional/data/test_gs_weird_bug.png').size;
  // Read the buffered data for comparision reasons
  var data = fs.readFileSync('./test/functional/data/test_gs_weird_bug.png');

  // Open a file handle for reading the file
  var fd = fs.openSync('./test/functional/data/test_gs_weird_bug.png', 'r', parseInt('0666',8));

  // Open the new file
  gridStore.open().then(function(gridStore) {

    // Write the file to gridFS using the file handle
    gridStore.writeFile(fd).then(function(doc) {

      // Read back all the written content and verify the correctness
      GridStore.read(db, fileId).then(function(fileData) {
        test.equal(data.toString('base64'), fileData.toString('base64'));
        test.equal(fileSize, fileData.length);

        db.close();
      });
    });
  });
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing how to write a file to Gridstore using file location path using a Generator and the co module.

var MongoClient = require('mongodb').MongoClient,
  co = require('co');
  test = require('assert');

co(function*() {
  var db = yield MongoClient.connect('mongodb://localhost:27017/test');
  // Our file ID
  var fileId = new ObjectID();

  // Open a new file
  var gridStore = new GridStore(db, fileId, 'w');

  // Read the filesize of file on disk (provide your own)
  var fileSize = fs.statSync('./test/functional/data/test_gs_weird_bug.png').size;
  // Read the buffered data for comparision reasons
  var data = fs.readFileSync('./test/functional/data/test_gs_weird_bug.png');

  // Open the new file
  yield gridStore.open();

  // Write the file to gridFS
  yield gridStore.writeFile('./test/functional/data/test_gs_weird_bug.png');

  // Read back all the written content and verify the correctness
  var fileData = yield GridStore.read(db, fileId);
  test.equal(data.toString('base64'), fileData.toString('base64'))
  test.equal(fileSize, fileData.length);

  db.close();
});</code></pre>
    


    
    <pre class="prettyprint"><code>// A simple example showing how to write a file to Gridstore using a file handle using a Generator and the co module.

var MongoClient = require('mongodb').MongoClient,
  co = require('co');
  test = require('assert');

co(function*() {
  var db = yield MongoClient.connect('mongodb://localhost:27017/test');
  // Our file ID
  var fileId = new ObjectID();

  // Open a new file
  var gridStore = new GridStore(db, fileId, 'w');

  // Read the filesize of file on disk (provide your own)
  var fileSize = fs.statSync('./test/functional/data/test_gs_weird_bug.png').size;
  // Read the buffered data for comparision reasons
  var data = fs.readFileSync('./test/functional/data/test_gs_weird_bug.png');

  // Open a file handle for reading the file
  var fd = fs.openSync('./test/functional/data/test_gs_weird_bug.png', 'r', parseInt('0666',8));

  // Open the new file
  yield gridStore.open();

  // Write the file to gridFS using the file handle
  yield gridStore.writeFile(fd);

  // Read back all the written content and verify the correctness
  var fileData = yield GridStore.read(db, fileId);
  test.equal(data.toString('base64'), fileData.toString('base64'));
  test.equal(fileSize, fileData.length);

  db.close();
});</code></pre>
    

    
</dd>

        </dl>
    
    
    
        <h3 class="subsection-title">Type Definitions</h3>
        
        <dl>
                
<dt>
    <div class="nameContainer">
        <h4 class="name" id="~collectionCallback">
            
            collectionCallback<span class="signature">(error, collection)</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line563">line 563</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>The collection callback format.</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>error</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="MongoError.html">MongoError</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                <p>An error instance representing the error during the execution.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>collection</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="Collection.html">Collection</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                <p>The collection from the command execution.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    
</dd>

            
                
<dt>
    <div class="nameContainer">
        <h4 class="name" id="~gridStoreCallback">
            
            gridStoreCallback<span class="signature">(error, gridStore)</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line862">line 862</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>The tell callback format.</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>error</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="MongoError.html">MongoError</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                <p>An error instance representing the error during the execution.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>gridStore</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="GridStore.html">GridStore</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                <p>The gridStore.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    
</dd>

            
                
<dt>
    <div class="nameContainer">
        <h4 class="name" id="~openCallback">
            
            openCallback<span class="signature">(error, gridStore)</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line175">line 175</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>The callback format for the Gridstore.open method</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>error</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="MongoError.html">MongoError</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                <p>An error instance representing the error during the execution.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>gridStore</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="GridStore.html">GridStore</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                <p>The GridStore instance if the open method was successful.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    
</dd>

            
                
<dt>
    <div class="nameContainer">
        <h4 class="name" id="~readCallback">
            
            readCallback<span class="signature">(error, data)</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line746">line 746</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>The read callback format.</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>error</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="MongoError.html">MongoError</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                <p>An error instance representing the error during the execution.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>data</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Buffer</span>


            
            </td>
            
            
            
            <td class="description last">
                
                <p>The data read from the GridStore object</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    
</dd>

            
                
<dt>
    <div class="nameContainer">
        <h4 class="name" id="~readlinesCallback">
            
            readlinesCallback<span class="signature">(error, strings)</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line645">line 645</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>The readlines callback format.</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>error</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="MongoError.html">MongoError</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                <p>An error instance representing the error during the execution.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>strings</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Array.&lt;string></span>


            
            </td>
            
            
            
            <td class="description last">
                
                <p>The array of strings returned.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    
</dd>

            
                
<dt>
    <div class="nameContainer">
        <h4 class="name" id="~resultCallback">
            
            resultCallback<span class="signature">(error, result)</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line259">line 259</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>The callback result format.</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>error</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="MongoError.html">MongoError</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                <p>An error instance representing the error during the execution.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>result</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">object</span>


            
            </td>
            
            
            
            <td class="description last">
                
                <p>The result from the callback.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    
</dd>

            
                
<dt>
    <div class="nameContainer">
        <h4 class="name" id="~tellCallback">
            
            tellCallback<span class="signature">(error, position)</span>
        </h4>
    
        
        <div class="tag-source">
            <a href="lib_gridfs_grid_store.js.html">lib/gridfs/grid_store.js</a>, <a href="lib_gridfs_grid_store.js.html#line833">line 833</a>
        </div>
        
    </div>

    
</dt>
<dd>
    
    
    <div class="description">
        <p>The tell callback format.</p>
    </div>
    

    
    
    
    
    
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>error</code></td>
            
            
            <td class="type">
            
                
<span class="param-type"><a href="MongoError.html">MongoError</a></span>


            
            </td>
            
            
            
            <td class="description last">
                
                <p>An error instance representing the error during the execution.</p></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>position</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>
            
            
            
            <td class="description last">
                
                <p>The current read position in the GridStore.</p></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    
</dd>

            </dl>
    
    
    
</article>

</section>  





                    <footer>
                        Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Oct 01 2018 09:50:14 GMT-0400 (EDT)
                    </footer>
                </div>
            </td>
        </tr>
    </table>
</div>
<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
<script src="scripts/main.js"></script>
</body>
</html>